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

file rotation can result in data being logged to multiple files #1905

Open
1 of 2 tasks
ledbit opened this issue Apr 7, 2021 · 3 comments
Open
1 of 2 tasks

file rotation can result in data being logged to multiple files #1905

ledbit opened this issue Apr 7, 2021 · 3 comments

Comments

@ledbit
Copy link
Contributor

ledbit commented Apr 7, 2021

Please tell us about your environment:

  • winston version?
    • winston@2
    • winston@3
  • _node -v outputs: v14.15.1
  • _Operating System? Linux
  • _Language? TypeScript 3.8

What is the problem?

When the rate of logging is fast, e.g. 200 lines/second and the file rotation with [maxsize, maxFiles, tailable] settings when files rotate the logger continues to write to old files forever, these old files get deleted but continue being written to leading to exhaustion of disk space

What do you expect to happen instead?

The logger should only be writing to one file at a time.

ledbit pushed a commit to diag/winston that referenced this issue Apr 7, 2021
@hallsbyra
Copy link

I see this all the time in Windows too.

Here's an example. Winston writes to both the current (output-debug.log) and an old (output-debug2.log) file. Leading to maxsize of 100mb not being respected.

image

@lamuertepeluda
Copy link

any news/ETA on this issue resolution? we fell into the same problem

@DABH
Copy link
Contributor

DABH commented Jan 8, 2024

Hi folks, I apologize that this issue has been sitting open for quite some time, but I'd encourage you to try the latest version of winston, which includes some fixes related to log rotation from the File transport (e.g. #2301). If anyone is able to confirm whether this issue is still happening or whether it seems resolved with the latest winston, that would be extremely helpful. And if it's still happening, any kind of MWE would be very helpful in order for others to more easily investigate and resolve an issue like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants