logging-log4j2
logging-log4j2 copied to clipboard
Wrapper layout compressing the output of a delegate (LOG4J2-3023)
As it was explained in https://github.com/apache/logging-log4j2/discussions/2495#discussioncomment-9186368, all JSON-based layouts are deprecated in favor of JSON Template Layout. However the GELF layout has a compressionType option, which is missing from the JTL.
Would be really nice to have, as it can save a nice amount of traffic costs.
Instead adding compression support to <your-layout-of-preference>, we better create a wrapper layout that compresses the output of another layout. This issue has already been discussed in LOG4J2-3023.
@der-eismann, would you be interested in submitting a PR? If so, I would be more than happy to assist you.
I'm kinda interested, but my Java knowledge is very basic and I'm not sure if my help is really useful here :see_no_evil:
I think we should introduce an OutputStream abstraction:
public interface OutputStreamWrapper {
OutputStream wrap(OutputStream stream);
}
Such an abstraction could solve several issues:
- it would allow users to introduce their own compression/decompression algorithms (apache/logging-log4j2#1508),
- it would allow us to remove the dependency on
commons-compressfrom Log4j Core, - it would allow users to implement some sort of end-to-end encryption (cf. LOG4J2-1000 and LOG4J2-2930).
I marked LOG4J2-3023 as duplicate of this issue, so we don't need to use JIRA any more.