Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.2.3
-
jdk 1.8
win10
Springboot Finchley.RELEASE
Description
It will add the contents of the exception to the end of the formatted log. As shown below, according to the format defined above, its content should end at the arrow.
logback.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml" /> <springProperty scope="context" name="springAppName" source="spring.application.name" /> <property name="LOG_FILE" value="${BUILD_FOLDER:-build}/${springAppName}" /> <appender name="kafkaAppender" class="com.github.danielwegener.logback.kafka.KafkaAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern> { "severity": "%level", "service": "${springAppName:-}", "trace": "%X{X-B3-TraceId:-}", "span": "%X{X-B3-SpanId:-}", "exportable": "%X{X-Span-Export:-}", "stack_trace": "%replace(%exception{10}){'\n',''}", "pid": "${PID:-}", "thread": "%thread", "class": "%logger{40}", "rest": "%message" } </pattern> </encoder> <topic>applog</topic> <keyingStrategy class="com.github.danielwegener.logback.kafka.keying.NoKeyKeyingStrategy" /> <deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" /> <!-- bootstrap.servers is the only mandatory producerConfig --> <producerConfig>bootstrap.servers=******** </producerConfig> </appender> <root level="INFO"> <appender-ref ref="kafkaAppender" /> </root> </configuration>