spring boot和logstash-logback-encoder版本匹配问题

在最近我想将我的日志输出到ELK框架中,结果却发现logstash-logback-encoder版本各种不匹配,用高版本的logstash-logback-encoder一直和spring boot不兼容,最后找了很久才找到一个spring boot 2.1.1能匹配的版本3.6,下面是我的pom文件,记得将spring-boot-starter-logging给除掉,因为这个里面包含有logback的版本过低。除了2.0版本外,我也找到了一个与1.5版本匹配的5.2logstash-logback-encoder,在最下面。



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.1.RELEASE
         
    
    com.xiaohuan
    test
    0.0.1-SNAPSHOT
    test
    Demo project for Spring Boot
    jar
    
        1.8
    
    
        
            org.springframework.boot
            spring-boot-starter-web
            
                
                    org.springframework.boot
                    spring-boot-starter-logging
                
            
        

        
            org.slf4j
            slf4j-api
            1.7.7
        
        
            net.logstash.logback
            logstash-logback-encoder
            3.6
        
        
        
            ch.qos.logback
            logback-classic
            1.1.2
        
        
            ch.qos.logback
            logback-access
            1.1.2
        
        
            ch.qos.logback
            logback-core
            1.1.2
        

        
        
             org.apache.maven.plugins
            maven-clean-plugin
            3.1.0
        
        
             org.apache.maven.plugins
            maven-resources-plugin
            3.1.0
        
        
             org.apache.maven.plugins
            maven-compiler-plugin
            3.8.0
        
        
             org.apache.maven.plugins
            maven-jar-plugin
            3.1.0
        
        
             org.apache.maven.plugins
            maven-deploy-plugin
            2.8.2
        
    
    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    

下面是1.5版本的



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        1.5.10.RELEASE
         
    
    com.xiaohuan
    elktest
    0.0.1-SNAPSHOT
    elktest
    Demo project for Spring Boot

    
        1.8
        1.2.3
    

    
        
            
                ch.qos.logback
                logback-core
                ${ch.qos.logback.version}
            
            
                ch.qos.logback
                logback-classic
                ${ch.qos.logback.version}
            
            
                ch.qos.logback
                logback-access
                ${ch.qos.logback.version}
            
        
    
    
        
            org.springframework.boot
            spring-boot-starter-web
            
                
                    org.springframework.boot
                    spring-boot-starter-logging
                
            
        
        
            org.slf4j
            slf4j-api
            1.7.7
        
        
            net.logstash.logback
            logstash-logback-encoder
            5.2
        
        
        
            ch.qos.logback
            logback-core
            1.2.3
        
        
            ch.qos.logback
            logback-classic
            1.2.3
        
        
            ch.qos.logback
            logback-access
            1.2.3
        
        
        
            commons-logging
            commons-logging
            1.2
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    



你可能感兴趣的:(Spring,boot)