本文介绍了如何从Sleuth日志中删除X-B3前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除"X-Span-Export":"true","X-B3-SpanId":"40bcdc1c4fcdb9c0&","X-B3-TraceId":"40bcdc1c4fcdb9c0&"}">

形成我的日志.

我在application.yml中添加了以下配置,但没有帮助.

Application.yml

春天:应用:名称:应用名称个人资料:dev侦探:采样器:机率:1.0日志:slf4j:列入白名单的mdc密钥:主体行李钥匙:负责人

JSON日志

  {"@timestamp":"2020-12-02T13:58:35.343 + 03:00","@ version":"1",消息":请求{} helloChasis from chasis-ms","logger_name":"az.iba.ms.chasis.controller.ChasisController","thread_name":"http-nio-8080-exec-1","level":"INFO","level_value":20000,"traceId":"40bcdc1c4fcdb9c0","spanId":"40bcdc1c4"fcdb9c0","span:""-S"-exportable";:"true","X-B3-SpanId":"40bcdc1c4fcdb9c0&","X-B3-TraceId":"40bcdc1c4fcdb9c0&"} 
解决方案

只需设置您自己的 logging.pattern.level ,即可在其中定义自己的日志记录模式.如果您有一个,则将覆盖默认的Sleuth.

I want to remove X-Span-Export":"true","X-B3-SpanId":"40bcdc1c4fcdb9c0","X-B3-TraceId":"40bcdc1c4fcdb9c0"}

form my log .

I have added below configuration to application.yml but no help.

Application.yml

spring:application:name: app-nameprofiles: devsleuth:sampler:probability : 1.0log:slf4j:whitelisted-mdc-keys: principalbaggage-keys: principal

JSON Log

 {"@timestamp":"2020-12-02T13:58:35.343+03:00","@version":"1","message":"Request {}helloChasis from chasis-ms","logger_name":"az.iba.ms.chasis.controller.ChasisController","thread_name":"http-nio-8080-exec-1","level":"INFO","level_value":20000,"traceId":"40bcdc1c4fcdb9c0","spanId":"40bcdc1c4fcdb9c0","spanExportable":"true","X-Span-Export":"true","X-B3-SpanId":"40bcdc1c4fcdb9c0","X-B3-TraceId":"40bcdc1c4fcdb9c0"}
解决方案

Just set your own logging.pattern.level where you will define your own logging pattern. If you have one then you'll override the default Sleuth one.

这篇关于如何从Sleuth日志中删除X-B3前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 08:17