java project datadog logs

java project datadog logs,第1张

java project datadog logs

1、Add dependence on pom.xml


  ch.qos.logback
  logback-classic
  1.2.9


  net.logstash.logback
  logstash-logback-encoder
  6.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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5710292.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存