spring日志输出到elasticsearch

1.maven

        
        
            com.agido
            logback-elasticsearch-appender
            3.0.8
        
        
            net.logstash.logback
            logstash-logback-encoder
            7.3
        
        
        
            co.elastic.clients
            elasticsearch-java
            8.7.1
        

2.logback.xml配置

    
    
        
        ip:port
        
            {"serviceId":"web-app"}
            startTime
            endTime
            requestRawJson
            responseRawJson
            responseTime
            url
            method
            path
        

        32000
    

    
    
        
        
    

    
    
        
        
    
    
    

3.日志记录情况

spring日志输出到elasticsearch_第1张图片

spring日志输出到elasticsearch_第2张图片

你可能感兴趣的:(java,elasticsearch)