Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIs it possible to disable rotation? #96
Closed
Comments
This comment has been minimized.
This comment has been minimized.
The point of lumberjack is to rotate logs, if you don't need rotation, don't use lumberjack, or make it optional to use lumberjack in your codebase. |
This comment has been minimized.
This comment has been minimized.
@xiegeo that's fair. I was hoping to find an alternative to removing lumberjack from github.com/kubernetes/kubernetes by having a disable rotation flag, but as you pointed out, it's better to make it optional. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some environments, it might be advisable to disable log rotation and let another process handle that work.
I originally thought that setting
MaxSize: 0
would disable log rotation, but thefunc (l *Logger) max()
function returns thedefaultMaxSize
:to preserve existing behavior, would you be open to adding a
disableFileRotation
field to theLogger
struct and replacing the various:with:
This should be backward compatible behavior, since the default value for
disableFileRotation
would befalse
and only interested parties would set it totrue
.Another alternative would be to set
MaxSize
to-1
and change behavior accordingly, but many consumer of lumberjack already error on negative values.