This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
JSON
MOZGIII edited this page Mar 22, 2019
·
3 revisions
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.
The 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.
Jar | Maven or Ant+Ivy |
---|---|
logback-ext-json-core-version.jar |
Not necessary. Pulled automatically by other dependencies below. |
logback-ext-json-classic-version.jar |
<dependency> <groupId>ch.qos.logback.extensions</groupId> <artifactId>logback-ext-json-classic</artifactId> <version>version</version> <scope>runtime</scope> </dependency> |
logback-ext-jackson-version.jar |
<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> |
Example TBD