Why does the Composite Encoder/Layout configuration not work ? #920
-
|
Composite Encoder/Layout According to the configuration in the documentation link, but the stack trace does not take effect.
My logback.xml is as follows:
Local debug, class ShortenedThrowableConverter didn't get to the corresponding configuration value (for example: maxDepthPerThrowable shortenedClassNameLength and maxLength) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The <conversionRule conversionWord="stack" converterClass="net.logstash.logback.stacktrace.ShortenedThrowableConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%thread] - %msg%n%stack{5,1024,10,rootFirst,regex1,regex2,evaluatorName}</pattern>
</encoder>
</appender>When used within a I tried your configuration file, and all the options were configured properly, but I had to add a missing When stopping at a breakpoint as shown in your image, the options will have already been set by logback. You can inspect the |
Beta Was this translation helpful? Give feedback.

The
parseOptionsmethod is only relevant when parsing options from a string format when used by the pattern layout. For example:When used within a
LoggingEventCompositeJsonEncoder(just like your example), the options are set directly via the setter methods from logback's xml configuration logic. In other words,parseOptionsis not taken i…