1
我想要在我的logback-sping.xml中添加Sleuth Span-Id和Trace-Id additonalFields GELF appeneder但沒有運氣。它們在控制檯的實際日誌文件輸出中顯示正常,但在Graylog中它們不顯示。注意:配置文件工作得很好。無法獲得GELF Appender添加偵查跨度Id
<property name="CONSOLE_LOG_PATTERN" value="%date{ISO8601} [${springProfile}] [${springAppName:-},%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-Span-Export:-}] [%level] [${PID}] [%X{bindName}] [%thread] [%logger{10}] : %msg%n %ex{20}"/>
<springProfile name="integration,qa,prod">
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
<graylogHost>${graylogProtocol}:${graylogHost}</graylogHost>
<graylogPort>${graylogPort}</graylogPort>
<facility>${springAppName}</facility>
<additionalFields>profile=${springProfile},traceid=%X{X-B3-TraceId:-},spanid=%X{X-B3-SpanId:-}</additionalFields>
<extractStackTrace>true</extractStackTrace>
<filterStackTrace>true</filterStackTrace>
<maximumMessageSize>8192</maximumMessageSize>
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSSS</timestampPattern>
</appender>
</springProfile>
也試過這樣:
<additionalFields>profile=${springProfile},traceid=${X-B3-TraceId},spanid=${X-B3-SpanId}</additionalFields>
沒有運氣。