Search code examples
node.jsexpresswinston

Winston not logging at any log level, what could be wrong?


I have run in to a weird bug and don't know how to proceed/debug. I have an app that's written in Nodejs and uses Winston for logging. Everything was working fine until I brought up a new production server yesterday and retired the old one.

My prod server has 4 Nodejs processes running. On the new production server, Winston logs the very first log message per .js file, period. It stops logging after that, and changing the log level doesn't work. My app has got about 6 .js files, and in case of any error on any of those files, the very first error message gets logged but any subsequent errors/warning/info are not logged.

The funny thing is Winston was working just fine on the old prod server and the dev server still works fine.

I am on Winston 0.6.2 on both dev and prod. As far as I know, all the sw packages are the same between dev and prod.

How can I debug this issue?


Solution

  • After some research, I came across this issue => https://github.com/flatiron/winston/issues/227

    Looks like, the new way of handling streams in the latest version of node has broken file transport in winston. I am going back to node v0.8.22 for the time being as a work around.