First write rotation won't clean up backups #12

Closed
natefinch opened this Issue May 20, 2015 · 2 comments

Comments

Projects
None yet
1 participant
Owner

natefinch commented May 20, 2015

If you start your application with multiple backups in your log folder, and your first write to lumberjack would cause the existing file to go over the max size, we just rename the existing file and create a new one, without going through cleanup of old backups.

@natefinch natefinch added the bug label May 20, 2015

@natefinch natefinch self-assigned this May 20, 2015

Owner

natefinch commented May 20, 2015

Going to work on fixing this tonight.

natefinch added a commit that referenced this issue May 21, 2015

Fix bug #12
Fixes bug #12. If the first write to a file would cause it to rotate, instead
of rotating, we'd just move it aside.  This change fixes that problem
by ensuring that we just run rotate in this situation, which does the
right thing (open new and then cleanup.)  Also added test to verify
the fix.
Owner

natefinch commented May 21, 2015

Fixed! Added a test for this issue as well.

@natefinch natefinch closed this May 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment