Open anarcat opened 7 years ago
Yeah, in retrospect, I realized that making the rotation size in megabytes was a mistake. It should have been bytes, like most other Go sizes.
Are you actually planning on using lumberjack in an embedded platform? I'd be interested to hear what the constraints are like.
i'm building this tool called wallabako that runs on Kobo e-readers. /var/log
is ... 16KB. There's more storage elsewhere (e.g. ~3GB) so i worked around that problem, but i would like to use the normal log rotation because (presumably) it would also cleanup those logs on reboot...
Neat. :) Adding a MaxBytes value is certainly an option, and wouldn't be too hard. Give me a little time to think about it.
thanks!
@natefinch My team is also interested in using lumberjack on an embedded device.
Are you still considering making this change? If time is an issue are you open to a contribution? Thank you
Hi.. I could see the change to reduce the max size of log file is still not merged to lumberjack. Are there any blockers? It will be useful. Even time based log rotation periodically also helps.
Hi @natefinch, thank you for your work & this repository. Is there something blocking the PR #97? I need this feature too for an embedded environment. If something is missing or blocking, i can contribute to resolve that.
The main problem is "deprecating" the other value.
I think what we need is a v3 that just switches to bytes (and fixes some other problems with the interface in this package). I have been meaning to do that for a while now.
Ok, is there a roadmap ? Do you need help ?
Sorta and maybe :)
see #115
it's too bad that the file size rotation limit is in megabytes - that's actually a huge number for embeded platforms. it would be better to rotate on kilobytes or, fundamentally, bytes: one can then use multiples to find the proper value using, e.g. humanize:
fmt.Println("10 MB: %d", 10 * humanize.MiByte)
...i understand this may involve an API change, but maybe there could just be another MaxBytes settings?