Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
somnathpanja opened this issue Sep 7, 2015 · 17 comments
Labels
winston-file Issues to move to `winston-file` when we create it

Comments

@somnathpanja
Copy link

somnathpanja commented Sep 7, 2015

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
})
]
});

@ybrodsky
Copy link

Same here

@kesav02
Copy link

kesav02 commented Apr 7, 2016

Same here, any resolution?

@somnathpanja
Copy link
Author

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" notifications@github.com wrote:

Same here, any resolution?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#705 (comment)

@reduxdj
Copy link

reduxdj commented May 23, 2016

No log files are being created, makes me sad

@full-of-foo
Copy link

Same here

@mhawila
Copy link

mhawila commented Aug 21, 2017

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

@casper666
Copy link

Same here

@stormeyes
Copy link

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

@indexzero indexzero added the winston-file Issues to move to `winston-file` when we create it label Jan 29, 2019
@sonic-interlock
Copy link

Same here :(

@piercy
Copy link

piercy commented Aug 16, 2019

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

@somnathpanja
Copy link
Author

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.

@ramswish
Copy link

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

@441066
Copy link

441066 commented Jul 19, 2021

Same =(

@chneil
Copy link

chneil commented Jul 21, 2021

+1 this PR winstonjs/winston-daily-rotate-file#323 which will recreate the log file on accidental deletion

@gsd447
Copy link

gsd447 commented Oct 30, 2023

same here

@wbt
Copy link
Contributor

wbt commented Nov 8, 2023

@gsd447 what versions are you using? Can you share more detail? The PR which was supposed to fix this was merged a while ago.

@seidhkona
Copy link

seidhkona commented Apr 16, 2024

It seems like this issue is still not fixed (I'm running latest version of Winston). And I've tried DailyRotateFile as mentioned in this thread(winstonjs/winston-daily-rotate-file#376), but it also doesn't work, unless the documentation is lacking some more details on how to set it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
winston-file Issues to move to `winston-file` when we create it
Projects
None yet
Development

Successfully merging a pull request may close this issue.