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

Compressed logs should unambiguously be gzip files ending in .gz, not "zip" files #65

Closed
ijackson opened this issue Sep 5, 2020 · 1 comment

Comments

@ijackson
Copy link
Contributor

ijackson commented Sep 5, 2020

Hi. Thanks for your contribution to the Rust ecosystem.

I was reading the documentation for the compressed logging. I was puzzled to find all this discussion of "zip" files. It would be highly unusual for a program to write logs in actual zip format (the format expected by unzip). Traditional log management programs like logrotate and savelog make gzip files ending in .gz. Tools like zgrep which are usually used for inspecting logs expect gzip files.

I looked at the code, and indeed flexi_logger does make gzipped logfiles. But it calls them .zip, and the documentation is wrong too. Unfortunately I don't think this can fixed without at least some kind of breaking change: currently the file contents and file extension do not match.

I suggest that the right complete fix is to change (i) the file extension, from .zip to .gz (ii) the documentation, to refer to gzip rather than zip, (iii) all the in-Rust names, changing Zip to Gzip everywhere, (iv) all the corresponding names in the configuration (env, specfile, etc.). [Option 1]

How much do you want to worry about compatibility ? In some of these cases it would be possible to provide aliases, although that's a fair amount of work. I think we could provide aliases for the builder methods and probably for the configuration. [Option 2]

Going in the other direction, we could retain the existing programmatic names and merely change the docs and the file extension. That would avoid this being a build break, and in practice would be unlikely to break production systems, although it would leave the anomalous names in Rust source code and logger spec files. This is also quite easy, since the spec handling wouldn't need changing :-). [Option 3]

Since we'll be changing the file extension, I guess we should arrange to at least rotate away the .zip files made by older versions of flexi_logger, to avoid a situation where ancient .zip files , obsoleted by recent .gz files, are retained forever.

Please let me know what you prefer. I am happy to do the work to implement what I call options 1 and 3 above. My recommendation would be to do option 3 right away and then think about whether you need to go on to option 1 or 2.

I apologise for filing what you may see as a duplicate of #42. But I felt #42's framing was wrong. I wanted to set out a coherent (but opinionated) summary of the situation as I see it, under a corresponding title. I hope you find this helpful.

@emabee
Copy link
Owner

emabee commented Sep 19, 2020

Thanks a lot for this detailed analysis! Version 0.16.0 now uses .gz as file suffix, and all the documentation and the code are corrected.

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

2 participants