Include in your pom.xml
:
<dependency>
<groupId>io.kokuwa.micronaut</groupId>
<artifactId>micronaut-logging</artifactId>
<version>${version.io.kokuwa.micronaut.logging}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<!-- you can replace jsonp with jackson if you prefer jackson -->
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-jsonp</artifactId>
<scope>runtime</scope>
</dependency>
- Version 3.x is based on SLF4J 1.7 & Logback 1.2 & Micronaut 3.x
- Version 4.x is based on SLF4J 2.0 & Logback 1.4 & Micronaut 4.x
- set log level based on MDC values
- add default xml
- preconfigured appender for different environments
- set log level based on HTTP request header
- add HTTP path parts to MDC
- add HTTP header to MDC
- add authentication information from HTTP request to MDC
- configure mdc on refresh event
- read serviceName and serviceVersion from yaml
- support auto select appender with custom
logback.xml