winston is not creating the log file again if file is deleted manually or by other app

Created on 7 Sep 2015  Â·  12Comments  Â·  Source: winstonjs/winston

Below, how I create the logger instance. Initially it's logging properly but if my logrotate app deletes the log file then Winston is no longer creating the file again. It just silently ignoring and not logging anything.

var logger = new (winston.Logger)({
level: name,
levels: levels,
transports: [
new winston.transports.File({
filename: path.normalize(filePath),
options: { flags: 'a' },
json: false,
timestamp: function () {
return (new Date()).toUTCString();
},
formatter: formatterFunc
})
]
});

winston-file

Most helpful comment

No log files are being created, makes me sad

All 12 comments

Same here

Same here, any resolution?

Workaround: Currently im watching the files in every 45 sec. If not present
then re init the Winston logger to recreate the log files.
On 7 Apr 2016 17:26, "Avi Kessel" [email protected] wrote:

Same here, any resolution?

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/winstonjs/winston/issues/705#issuecomment-206833377

No log files are being created, makes me sad

Same here

Two years later and this ticket is still open?!! Am I missing something here?

Same here

Same here. And I found log4php has the same problem when PHP running in daemon mode(Swoole etc.). I just wanna know why.

Same here :(

+1, almost 4 years on and still open. Does make me worry about future support of winston...

winston is getting slower and slower day by day. They don't fixes basic problems. So why do I care?
Now I'm writing my own logger, I will share the repo publically soon, so you can contribute too.

@somnathpanja are you working on your logger ? i would like to contribute if you need any help ?

Was this page helpful?
0 / 5 - 0 ratings