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

Compressing rolled files #13

Closed
mholt opened this issue Sep 19, 2015 · 2 comments
Closed

Compressing rolled files #13

mholt opened this issue Sep 19, 2015 · 2 comments

Comments

@mholt
Copy link

mholt commented Sep 19, 2015

How would you feel about an option to gzip rolled log files?

@natefinch
Copy link
Owner

I think that would be very useful. I think giving lumberjack a func (io.Writer) io.WriteCloser that it could use to wrap a file and use to write the backups would be good (so people can provide their own favorite zip algorithm). We could add zipping to the tasks we do on old log files in the cleanup function (doing the actual compression in a separate goroutine to a temp file and then replace the non-compressed backup atomically with the compressed version... see natefinch/atomic for atomic replacements on platforms other than Linux... and ug, I need to actually fix up that repo so that it has like, tests and such).

@acmacalister
Copy link

That sounds like a good plan to me. I like the idea of the atomic writing for when we compression the old log files, so we ensure we don't lose any of the files or data.

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

No branches or pull requests

3 participants