Spring boot - sending emails with Logback

前端 未结 3 1492
栀梦
栀梦 2020-12-29 04:12

I am trying to configure Logback to send emails whenever an exception (Logging level: ERROR) occurs. I have not been able to make it work so far so I would like to ask for y

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 04:37

    Pls include following (from my working project) on pom.xml & logback.xml in order to get error mail :-

    pom.xml

        
            org.slf4j
            slf4j-api
            1.6.4
        
        
            ch.qos.logback
            logback-classic
            1.0.1
        
        
            org.slf4j
            jcl-over-slf4j
            1.6.4
        
        
            javax.mail
            mail
            1.4
        
    

    logback.xml

    
    
        
          xxx
          25
          me@gmail.com
          you@gmail.com
          App Err Mail
          
          
              ERROR
          
      
        
            
        
    
    

提交回复
热议问题