-
Is there any way to print <configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg %marker %n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration> It doesn't work for |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @viartemev , To print structured arguments when using a pattern layout, include an argument substitution string ( logger.info("log message {} {}",
StructuredArguments.keyValue("key1", "value1"),
StructuredArguments.keyValue("key2", "value2")); ... results in a log event with the message StructuredArguments will not be printed when using logback's Note that StructuredArguments and the markers provided by logstash-logback-encoder are primarily designed for use with the encoders provided by logstash-logback-encoder (e.g. |
Beta Was this translation helpful? Give feedback.
-
Thanks! |
Beta Was this translation helpful? Give feedback.
Hi @viartemev ,
To print structured arguments when using a pattern layout, include an argument substitution string (
{}
) for each structured argument in the message format string (just like non-structured arguments). For example...... results in a log event with the message
log message key1=value1 key2=value2
StructuredArguments will not be printed when using logback's
%markers
conversion word.Note that StructuredArguments and the markers provided by logstash-logback-encoder are primarily designed for use with the encoders provided by logstash-logback-…