2

I do not know exactly if this is a issue resolving around forever or the libraries I tried but maybe someone can help here.

I was using console.log() through my application (express) to write logs. Now I've switched to a more feature packed logging library, namely Winston.js. Configured winston like this:

var winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, {timestamp: true});

and replaced my console.log() entries with winston.info/winston.error, you name it. After I launched my app with node app.js everything went as expected. So I tried to run it with forever, since in production I run it that way.

Now I encountered the problem that the whole log file from forever, using just forever start app.js, was empty. Not a single log entry was there. I replaced winston with log4js, but the log file remained empty when launching it with forever.

Is there anything I am missing right now and if so where is the problem?

Sincerly, cschaeffler

cschaeffler
  • 453
  • 3
  • 5
  • 17
  • Related to http://stackoverflow.com/questions/10271373/how-can-i-add-timestamp-to-logs-using-node-js-library-winston – mvw Oct 25 '14 at 16:40

1 Answers1

0

It looks like you simply kept the Console transport without adding a transport for a file, e.g.,

winston.add(winston.transports.File, { filename: 'somefile.log' });
celeritas
  • 2,191
  • 1
  • 17
  • 28