Registry / logging / log4j-layout-template-json

log4j-layout-template-json

JSON →
library2.26.0javamavenunverified

A customizable, efficient, and garbage-free JSON layout for Apache Log4j that encodes log events according to a JSON template.

<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-layout-template-json</artifactId> <version>2.26.0</version> </dependency>
INSTALL
IMPORT
SIG · LOG4J-LAYOUT-TEMPL
L
log4j-layout-template-json
loggingjavav2.26.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JsonTemplateLayout
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout

Minimal example showing how to create a JsonTemplateLayout instance.

import org.apache.logging.log4j.layout.template.json.JsonTemplateLayout; import org.apache.logging.log4j.core.LogEvent; public class Example { public static void main(String[] args) { JsonTemplateLayout layout = JsonTemplateLayout.newBuilder().build(); System.out.println("JSON Template Layout created: " + layout.getContentType()); } }
Debug
Known issues
breakingLog4j 2.x JSON Template Layout requires Log4j 2.14.0 or later; older versions are not compatible.
fix
Upgrade Log4j to version 2.14.0 or higher to use this layout.
affects: <2.14.0
Upgrade
Version history
2.26.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
25
OpenAI (training)
1
Resources