lumberjack icon indicating copy to clipboard operation
lumberjack copied to clipboard

smaller sizes increments

Open anarcat opened this issue 8 years ago • 10 comments

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?

anarcat avatar Feb 14 '17 16:02 anarcat

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.

natefinch avatar Feb 14 '17 16:02 natefinch

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...

anarcat avatar Feb 14 '17 16:02 anarcat

Neat. :) Adding a MaxBytes value is certainly an option, and wouldn't be too hard. Give me a little time to think about it.

natefinch avatar Feb 14 '17 16:02 natefinch

thanks!

anarcat avatar Feb 14 '17 16:02 anarcat

@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

patrickmead avatar Feb 21 '19 15:02 patrickmead

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.

kirankumaralluvada avatar Jul 31 '20 11:07 kirankumaralluvada

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.

quen2404 avatar Oct 30 '20 11:10 quen2404

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.

natefinch avatar Oct 30 '20 12:10 natefinch

Ok, is there a roadmap ? Do you need help ?

quen2404 avatar Oct 30 '20 12:10 quen2404

Sorta and maybe :)

see #115

natefinch avatar Oct 30 '20 17:10 natefinch