spring boot +logback实现error级别特定日志报警

maven依赖

    ch.qos.logback
    logback-core
    1.1.8


    javax.mail
    mail
    1.4.7


    org.codehaus.janino
    janino
    3.0.7


    javax.activation
    activation
    1.1.1

logback.xml 文件配置



    
    
    
    
    
    
    


    
        ${smtpHost}
        ${smtpPort}
        ${username}
        ${password}
        false
        ${SSL}
        ${email_to}
        ${email_from}
        ${email_subject}
        
        
            %logger{0}%line%message
        
        
             
                message.contains("[email]")&&(level == ERROR)
            
            ACCEPT 
            DENY
        
        
        
            1
        
    
    
        
    

你可能感兴趣的:(spring,boot,java,工具)