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

Add a "monthly" option for frequency? #11

Closed
ravi opened this issue May 1, 2015 · 2 comments
Closed

Add a "monthly" option for frequency? #11

ravi opened this issue May 1, 2015 · 2 comments

Comments

@ravi
Copy link

ravi commented May 1, 2015

Most logs do not grow fast enough, by my estimate (wrong?), to be rotated "daily". A "monthly" option would be nice to have. I could try to use "Xm" and calculate (X as 30_24_60) but that assumes all months have 30 days.

I can submit a PR if there is interest.

@hxroger
Copy link

hxroger commented May 1, 2015

Ravi thanks for the feedback. We are looking at refactoring the module. We will include the monthly option for the defined rotation.

@rogerc
Copy link
Owner

rogerc commented Mar 7, 2017

Hi Ravi,

You can use monthly by using a date format that will only change once a month (at the start of each month).

// Rotate when the date format as calculated by momentjs is different (e.g monthly)
var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test-%DATE%.log", frequency:"custom", verbose: false, date_format: "YYYY-MM"});

@rogerc rogerc closed this as completed Mar 7, 2017
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

3 participants