SlyngDK / quarkus-logging-json-structured

Quarkus structed json logging POC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quarkus Logging Json Structured

Quarkus logging extension inspired of the work in logstash-logback-encoder

State of project

This is POC, to show a possible solution to do structured json logging in Quarkus.

#Structured argument If you want to do structured logging of arguments, then the argument send with your logging, can implement io.quarkus.logging.json.structured.StructuredArgument. Then it is possible to use the JsonGenerator to format the argument in json.

Simple usage

import static io.quarkus.logging.json.structured.KeyValueStructuredArgument.*;
...
log.info("Test log of structured arg", kv("key", "value"));

Custom Json Provider

It is possible to implement your own custom json provider.

Just extend io.quarkus.logging.json.structured.JsonProvider, and provide it using CDI.

About

Quarkus structed json logging POC

License:Apache License 2.0


Languages

Language:Java 100.0%