apache / logging-log4j2

Apache Log4j 2 is a versatile, feature-rich, efficient logging API and backend for Java.
https://logging.apache.org/log4j/2.x/
Apache License 2.0
3.4k stars 1.62k forks source link

log4j-layout-template-json Add support to Compact Log Event Format #3207

Open amosshi opened 3 days ago

amosshi commented 3 days ago

Warning! It is highly recommended to discuss feature requests in the mailing lists first.

[A clear and concise description of the feature requested.]

The Problem

Currently log4j2 provides several JSON templates at:

All of current template will generate log files with long key name, which produces bigger log output.

The Request

We deliver a compact JSON format, like CLEF or similar, to make the log output smaller.

Example: CLEF format could be 47% smaller than the default EcsLayout.json.

Reference

jaykataria1111 commented 3 days ago

Seems interesting,

I would be curious to know, how this is implemented, or looked into. I am getting familiar with the repoo, this looks like an interesting feature for people.

vy commented 3 days ago

@amosshi, @jaykataria1111, would you mind providing a JSON Template Layout event template for CLEF and publishing it as a part of the CLEF project with a Apache 2 License compatible license, please? If the CLEF community provides such an integration, we would be happy to point to it in the Log4j manual.

amosshi commented 2 days ago

Hi @vy , https://github.com/serilog/serilog-formatting-compact/issues/69 created for CLEF side.