-
-
Notifications
You must be signed in to change notification settings - Fork 753
Open
Description
logback 1.5 includes the ability to log formatted JSON messages using the new withFormattedMessage XML option:
https://logback.qos.ch/manual/encoders.html
Example configuration snippet that outputs formatted JSON log messages using the new logback 1.5 functionality:
<!-- Adopted from https://github.com/tchiotludo/akhq/blob/0.26.0/src/main/resources/logback.xml -->
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<immediateFlush>true</immediateFlush>
<encoder class="ch.qos.logback.classic.encoder.JsonEncoder">
<withFormattedMessage>true</withFormattedMessage>
<withMessage>false</withMessage>
<withArguments>false</withArguments>
</encoder>
</appender>
<root level="info">
<appender-ref ref="stdout"/>
</root>
<logger name="org.apache" level="WARN" />
<logger name="io.micronaut" level="WARN"/>
<logger name="io.micronaut.context.DefaultApplicationContext" level="INFO" />
<logger name="io.micronaut.runtime.Micronaut" level="INFO" />
</configuration>
PR #2350 would upgrade from logback 1.4, which was being implicitly chosen.
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Backlog