Skip to content
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

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

Open
amosshi opened this issue Nov 15, 2024 · 6 comments
Open

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

amosshi opened this issue Nov 15, 2024 · 6 comments
Assignees
Labels
enhancement Additions or updates to features layouts Affects one or more Layout plugins waiting-for-user More information is needed from the user

Comments

@amosshi
Copy link

amosshi commented Nov 15, 2024

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

@amosshi amosshi changed the title log4j-layout-template-json Add support to Compact Log Event Format (CLEF) log4j-layout-template-json Add support to Compact Log Event Format Nov 15, 2024
@jaykataria1111
Copy link
Contributor

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
Copy link
Member

vy commented Nov 15, 2024

@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.

@vy vy added waiting-for-user More information is needed from the user enhancement Additions or updates to features layouts Affects one or more Layout plugins and removed waiting-for-maintainer labels Nov 15, 2024
@amosshi
Copy link
Author

amosshi commented Nov 16, 2024

Hi @vy , serilog/serilog-formatting-compact#69 created for CLEF side.

@github-actions github-actions bot added waiting-for-maintainer and removed waiting-for-user More information is needed from the user labels Nov 16, 2024
@vy vy added waiting-for-user More information is needed from the user and removed waiting-for-maintainer labels Nov 18, 2024
@TiloGit
Copy link

TiloGit commented Jan 24, 2025

@amosshi I really like your idea and suggestion. Did you get a chance to add a PR to https://github.com/clef-json/clef-json.github.io?

@github-actions github-actions bot added waiting-for-maintainer and removed waiting-for-user More information is needed from the user labels Jan 24, 2025
@amosshi
Copy link
Author

amosshi commented Jan 24, 2025

Hi @TiloGit ,

I have connected with serilog/serilog-formatting-compact#69 - since it is a .NET library cannot used by Java application, so it is not proper to add a PR to it.

So the current idea is

For now,

  • we have created the compact file in an SAP Internal repo, and being validated in pipeline and will be used in Production environment in 2025 (I hope)
  • Once validated, and going through some open-source protocol, we will contribute it to https://github.com/sap-contributions/log4j-layout-template-json-compact
  • Then we will raise a PR to log4j2 document site, as @vy suggested

More info

  • The format https://github.com/clef-json/clef-json.github.io is still big than needed
  • Suppose we have more than 1 billion transaction per day, then every un-necessary extra character in log counts
  • So we need an even smaller format than clef-json

@vy
Copy link
Member

vy commented Jan 27, 2025

@amosshi, really liked the idea of releasing the template in a dedicated artifact! 🤩

  1. The provided sap-contributions/log4j-layout-template-json-compact link returns 404 for me, I can neither find a sap-contributions repository containing log4j in its name. Any ideas?
  2. Once you publish your project (with sufficient README.adoc meat) and validate it works, would you mind submitting PRs to Log4j's log4j-json-template-layout.adoc and clef-json.github.io, please?

@vy vy added waiting-for-user More information is needed from the user and removed waiting-for-maintainer labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions or updates to features layouts Affects one or more Layout plugins waiting-for-user More information is needed from the user
Projects
None yet
Development

No branches or pull requests

4 participants