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

Incorrect File Pointing Upon Application Restart #75

Open
bkvishe opened this issue Apr 10, 2024 · 1 comment
Open

Incorrect File Pointing Upon Application Restart #75

bkvishe opened this issue Apr 10, 2024 · 1 comment

Comments

@bkvishe
Copy link

bkvishe commented Apr 10, 2024

Below is my Pino configuration that utilizes the Pino-roll plugin for file rotation based on specified criteria. However, an issue arises upon application restart where the logger continues pointing to the old file, even after it has exceeded the rotation criteria.

image

Please refer to the below screenshot, where despite the file combine.1.log surpassing the rotation criteria and a new file combine.2.log being created by pino-roll, upon the application restart, the logger reverts back the pointing to the old file combine.1.log.

image

@ivan-tymoshenko
Copy link
Contributor

I think it works as expected, but IMHO that makes sense to change the default behavior.

https://github.com/mcollina/pino-roll?tab=readme-ov-file#options
Please not that limit only considers created log files. It will not consider any pre-existing files. Therefore, starting your logger with a limit will never tries deleting older log files, created during previous executions.

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

2 participants