Repository navigation
Conversation
… port) Pass the `compressionLevel` attribute of `DefaultRolloverStrategy` and `DirectWriteRolloverStrategy` to the `CompressActionFactory` in the `compressionLevel` option. The attribute was dropped when the compression moved to `log4j-compress`, so a level set in a configuration was ignored. The level is the native level of the algorithm and applies to `zip`, `gz`, `bzip2`, `deflate` and `zstd`, as in 2.x. A level rejected by the algorithm is reported once and the default level is used. Algorithms without configurable levels (`xz`, `lzma`, `lz4-*`, `snappy-framed`) ignore the option with a warning.
Contributor
|
The port keeps the contract agreed on #4234, and the new tests catch a broken factory or validator. |
…gelog entry Run the configuration test for both strategies with a tempCompressedFilePattern too, which compresses into a temporary file first. Passing no options on that path now fails the test. Use a one line changelog description and list this pull request next to the one it ports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Port of #4234 to
main. Inmain, a configuredcompressionLevelis ignored because the strategies always pass an emptyoptionsmap toCompressActionFactory.The attribute is passed in the
compressionLeveloption and is interpreted as the native compression level of the algorithm. It applies tozip,gz,bzip2,deflateandzstd, as in 2.x. A level the algorithm does not support is reported once and the default level is used, except forzstd, which adjusts levels outside of its range. With a level, the compressor of the algorithm is created directly instead of through theCompressorStreamProvider, because that interface cannot take a level.These algorithms ignore the option with a warning:
xz, because Add ZstdCompressAction to support configurable Zstandard compression levels #4234 does not apply levels to it either,lzma, because setting the level needsorg.tukaani.xz.LZMA2Optionsandlog4j-compressdoes not havexzas a compile dependency,lz4-block,lz4-framedandsnappy-framed, because Commons Compress has no numeric level for them.Differences from 2.x
RollingFileManageris created.CompressActionFactoryto validate the options, which extends the public API,createCompressActionwith placeholder file names just to trigger the warning, which could have side effects in third-party factories.zstdlevel outside of the range of Zstandard is adjusted by Zstandard without a warning. 2.x reports it and uses the default level.