1、Add dependence on pom.xml
ch.qos.logback logback-classic1.2.9 net.logstash.logback logstash-logback-encoder6.6
2、Add or modify the logback.xml of your service’s code.
logback INFO 10 u2028 {"dd": {"trace_id": "%X{dd.trace_id}", "span_id": "%X{dd.span_id}" }, "level":"%-5level", "message":"[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %-5level env:${dd.env} service:${dd.service} class:%logger{80}:%line - %message %exception{full}" } 0 2048 true
3、re-deploy the api’s service
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)