You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by shamoh February 12, 2023
I use TraceIDConverter to log request ID or ContextEntryConverter for additional information. But it does not work in case of AsyncAppender. Target appender is ConsoleAppender.
My configuration is:
<configurationscan="false"debug="false">
<conversionRuleconversionWord="traceId"converterClass="kamon.instrumentation.logback.tools.TraceIDConverter"/>
<conversionRuleconversionWord="contextEntry"converterClass="kamon.instrumentation.logback.tools.ContextEntryConverter"/>
<appendername="STDOUT"class="ch.qos.logback.core.ConsoleAppender">
<encoderclass="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<timestamp/>
<pattern>
<omitEmptyFields>true</omitEmptyFields>
<pattern>
{
"request-id": "%traceId",
"entry-component": "%contextEntry{entryComponent}",
}
</pattern>
</pattern>
</providers>
</encoder>
</appender>
<appendername="ASYNC-STDOUT"class="ch.qos.logback.classic.AsyncAppender">
<queueSize>8192</queueSize>
<neverBlock>true</neverBlock>
<discardingThreshold>25</discardingThreshold>
<appender-refref="STDOUT"/>
</appender>
<loggername="com.example.my"level="INFO"/>
<rootlevel="INFO">
<appender-refref="ASYNC-STDOUT"/> <!-- does NOT work --><!-- OR -->
<appender-refref="STDOUT"/> <!-- it WORKS -->
</root>
</configuration>
If I use STDOUT appender it correctly logs request-id and entry-component. While in case of ASYNC-STDOUT appender it does not log entry-component and request-id is undefined.
Discussed in #1260
Originally posted by shamoh February 12, 2023
I use
TraceIDConverter
to log request ID orContextEntryConverter
for additional information. But it does not work in case ofAsyncAppender
. Target appender isConsoleAppender
.My configuration is:
If I use
STDOUT
appender it correctly logsrequest-id
andentry-component
. While in case ofASYNC-STDOUT
appender it does not logentry-component
andrequest-id
isundefined
.Documentation (https://kamon.io/docs/latest/instrumentation/logback/) says
AsyncAppender
is supported. Do I use wrong combination of appender and encoder?The text was updated successfully, but these errors were encountered: