Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The Logback JSON extension allows log messages to be formatted as JSON. It must be paired with another extension that enables your desired JSON Processor (see below).
This extension is organized as 3 modules:
logback-ext-json-core: Provides base classes needed for handling any type of logging event.
logback-ext-json-access: Provides classes for formatting access Logback [IAccessEvent] (http://logback.qos.ch/apidocs/ch/qos/logback/access/spi/IAccessEvent.html) events.
logback-ext-json-classic: Provides classes for formatting standard Logback ILoggingEvent events.
The above JSON modules provide only general Logback JSON support. They cannot function alone - they must be paired with a JSON Processor of your choice, based on your application's runtime requirements.
logback-ext-jackson module is currently the only out-of-the-box JSON Processor module, which uses the Jackson JSON Processor - a very common processor in Java applications. Additional JSON processor module implementations can be added by the community as necessary.
- Add the following .jars to your application's classpath:
|Jar||Maven or Ant+Ivy|
||Not necessary. Pulled automatically by other dependencies below.|
<dependency> <groupId>ch.qos.logback.extensions</groupId> <artifactId>logback-ext-json-classic</artifactId> <version>version</version> <scope>runtime</scope> </dependency>
<dependency> <groupId>ch.qos.logback.extensions</groupId> <artifactId>logback-ext-jackson</artifactId> <version>version</version> <scope>runtime</scope> </dependency>
|A Jackson implementation .jar of your choice1||
<dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>Jackson Version</version> <scope>runtime</scope> </dependency>