micronaut-logging/README.md
Stephan Schnabel 2682a7a549
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
chore: fix invalid renovate preset configuration
2025-06-28 13:33:36 +02:00

44 lines
2.2 KiB
Markdown

# Micronaut Logging support
Enhanced logging for Micronaut using MDC or request header.
[![maven](https://img.shields.io/maven-central/v/io.kokuwa.micronaut/micronaut-logging.svg?label=maven)](https://central.sonatype.com/artifact/io.kokuwa.micronaut/micronaut-logging)
[![license](https://img.shields.io/badge/license-EUPL%201.2-blue)](https://git.kokuwa.io/kokuwaio/micronaut-logging/src/branch/main/LICENSE)
[![issues](https://img.shields.io/gitea/issues/open/kokuwaio/micronaut-logging?gitea_url=https%3A%2F%2Fgit.kokuwa.io)](https://git.kokuwa.io/kokuwaio/micronaut-logging/issues)
[![prs](https://img.shields.io/gitea/pull-requests/open/kokuwaio/micronaut-logging?gitea_url=https%3A%2F%2Fgit.kokuwa.io)](https://git.kokuwa.io/kokuwaio/micronaut-logging/pulls)
[![build](https://ci.kokuwa.io/api/badges/kokuwaio/micronaut-logging/status.svg)](https://ci.kokuwa.io/repos/kokuwaio/micronaut-logging/)
Include in your `pom.xml`:
```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>
```
## Features
* Version [3.x](https://github.com/kokuwaio/micronaut-logging/tree/3.x) is based on SLF4J 1.7 & Logback 1.2 & Micronaut 3.x
* Version [4.x](https://github.com/kokuwaio/micronaut-logging/tree/main) is based on SLF4J 2.0 & Logback 1.4 & Micronaut 4.x
* [set log level based on MDC values](docs/features/logback_mdc_level.md)
* [add default xml](docs/features/logback_default.md)
* [preconfigured appender for different environments](docs/features/logback_appender.md)
* [set log level based on HTTP request header](docs/features/http_log_level.md)
* [add HTTP path parts to MDC](docs/features/http_mdc_path.md)
* [add HTTP header to MDC](docs/features/http_mdc_header.md)
* [add authentication information from HTTP request to MDC](docs/features/http_mdc_authentication.md)
## Open Topics
* configure mdc on refresh event
* read **serviceName** and **serviceVersion** from yaml
* support auto select appender with custom `logback.xml`