Search code examples
javascriptnode.jslogginglogfileswinston

What is the default location of Winston logs?


I am using something like this:

var winston = require('winston'), logger = new (winston.Logger)({
  transports: [
    new (winston.transports.Console) (),
    new (winston.transports.File) ({filename: 'test.log'})
  ]
});

logger.log('Hello world');

I cannot find the log file test.log anywhere on my system and no exception or info in the console either.


Solution

  • Nevermind, I found the answer. If you do not specify directory, it is in the same directory as the code.