Open der-eismann opened 5 months ago
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:
commons-compress
from Log4j Core,I marked LOG4J2-3023 as duplicate of this issue, so we don't need to use JIRA any more.
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.