log: pull in logrotator, switch to ZSTD compressor #2237
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The log rotator we currently use is from a now-unmaintained repo: https://github.com/jrick/logrotate/tree/master
Which is fine, it works. But this issue lightninglabs/taproot-assets#1084 prompted me to look at how we could switch from gzip to zstd for log compression (better compression at the default level: https://pkg.go.dev/github.com/klauspost/compress/zstd#readme-performance).
Since the log rotator is one short file, it seems easiest to just pull it into this repo directly vs. fork the
logrotate
package and release this updated version with ZSTD support, and then pull that in as a dependency.If this gets merged to
btcd
, we could do the samelnd
and then drop thelogrotate
dependency there as well. Once it's in the lndbuild
package, it could be used from thetaproot-assets
project.The diff from upstream
logrotate
is quite small, and can be checked easily:This is a more minimal diff from difftastic (https://difftastic.wilfred.me.uk/) with upstream on the left, and my version on the right: