how to set winston log path to project local folder

I have installed winston locally, and specified log filename: './dataTest.log'.

var winston = require('winston');
winston.add(winston.transports.File, { filename: './dataTest.log' });

But I then found the log file sitting at user home folder. (Which is /Users/username I'm on Macos). Why? I expected it to sit in mynodeproject/public folder.

Tried to set the path as 'dataTest.log', same result.

EDIT: this is probably have more to do with node? So how do you set relative path in node?

Off top of my head, try using 'data.log' instead of './data.log'.

You must include the code you used for configuring and logging with Winston in order for us to help.

Also exactly what do you mean when you say you installed winston locally?

If the file was specified as './data.log' and that was written to your home folder, then the current working directory during runtime was probably your home folder. Did you run the node program from your home folder?