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

Log file rewrite (not appended) if time range lower than time mask #181

Open
andrejs82git opened this issue Jul 11, 2022 · 0 comments
Open

Comments

@andrejs82git
Copy link

Hi!

I was try to use pm2-logrotate with that params

  • rotateInterval = * * * * * (rotate every minute)
  • dateFormat=YYYY-MM-DD (not have minute)

And it work fine, exclude one thing, - every new minutecreating new empty logfile and write new portion from main log file.

I am not familiar with pm2-logrotate code, but i found code that looks like can fixing that befavior.

--var writeStream = fs.createWriteStream(final_name, {'flags': 'w+'});
++var writeStream = fs.createWriteStream(final_name, {'flags': 'a+'});

just change w+ to a+, i think it will logical. It will append one more portion of log file and not dangerous to delete useful information.

Thanks a lot!

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

1 participant