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 won't get rolled if the process restarted daily #200

Merged
merged 1 commit into from
Apr 21, 2014

Conversation

lulurun
Copy link

@lulurun lulurun commented Apr 21, 2014

The dateFile appender works fine for server processes, I found the problem when I use it in a daily cron job.

this.lastTimeWeWroteSomething is inited with current time, so if we restart a process on a daily base, it will always return the same date string,
=> The log file will never get rolled and it will keep growing.

The fix is done by checking existing log file, if there is one then get lastTimeWeWroteSomething from the file stat.

nomiddlename added a commit that referenced this pull request Apr 21, 2014
file won't get rolled if the process restarted daily
@nomiddlename nomiddlename merged commit 5e0982f into log4js-node:master Apr 21, 2014
@nomiddlename
Copy link
Collaborator

Thanks for this.

@nomiddlename
Copy link
Collaborator

Pushed to npm in v0.6.14

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

Successfully merging this pull request may close these issues.

2 participants