-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move compression into new log4j-compress
module
#2921
Merged
Merged
Conversation
This file contains 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
ppkarwasz
force-pushed
the
feature/main/move-commons-compress2
branch
from
September 6, 2024 18:20
5b21302
to
3d35565
Compare
vy
reviewed
Sep 12, 2024
...-compress/src/main/java/org/apache/logging/log4j/compress/commons/CommonsCompressAction.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/logging/log4j/core/appender/rolling/action/CompressActionFactory.java
Outdated
Show resolved
Hide resolved
src/site/antora/modules/ROOT/pages/manual/appenders/rolling-file.adoc
Outdated
Show resolved
Hide resolved
src/site/antora/modules/ROOT/partials/features/compression.adoc
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractCompressAction.java
Outdated
Show resolved
Hide resolved
vy
approved these changes
Sep 13, 2024
We move the code that depends on Commons Compress into a new `log4j-compress` module. At the same time, we perform the following behavioral changes: - Compression is performed by the `CompressActionFactoryProvider`, with the maximum order. In the current setting, if `log4j-compress` is on the classpath, it is used for everything, even GZ and ZIP. - The `compressionLevel` parameter, specific to the GZ and ZIP compression factories in the JRE, is replaced by a more generic `compressionOptions` map. This will allow adding more compression options in the future if users request it. - The available list of compression algorithms is no longer hardcoded, but depends entirely on the list of compressors supported by Apache Commons Compress. > [!NOTE] > Currently Commons Compress does not offer an algorithm-independent > interface to supply additional compression options. > However, each algorithm does provide such a way. Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
ppkarwasz
force-pushed
the
feature/main/move-commons-compress2
branch
from
September 24, 2024 20:49
bd12a68
to
4867237
Compare
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.
We move the code that depends on Commons Compress
into a new
log4j-compress
module.At the same time, we perform the following behavioral changes:
CompressActionFactoryProvider
, with the maximum order. In the current setting, iflog4j-compress
is on the classpath, it is used for everything, even GZ and ZIP.compressionLevel
parameter, specific to the GZ and ZIP compression factories in the JRE, is replaced by a more genericcompressionOptions
map. This will allow adding more compression options in the future if users request it.Note
Currently Commons Compress does not offer an algorithm-independent
interface to supply additional compression options. However, each algorithm does provide such a way.
If there are requests from users to support these options, we can extend the
RolloverStrategy
implementations.Until that happens I am reluctant to add additional features.
Review guide
The main change revolves around the replacement of
FileExtension
with 2 new interfaces:CompressActionFactory
: this class inherits the instance methods fromFileExtension
and allows to create lambdas that compress files.CompressActionFactoryProvider
: a new Log4j plugin type that can be used to register new compression algorithms. In practice there are two implementations (one for the algos in the JRE and one for Apache Commons Compress). All the remaining compression algorithms should extend Commons Compress.