Akka SLF4J logback configuration and usage

前端 未结 4 1679
-上瘾入骨i
-上瘾入骨i 2020-12-08 01:08

I have done the following steps to try and configure logging for my akka application:

  • created an application.conf file and placed it in src/main/resources.

4条回答
  •  萌比男神i
    2020-12-08 01:48

    The only thing I would change in your setup is to add the weiglewilczek slf4j adapter.

    I've got the following setup working just fine:

    akka {
      event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
      loglevel = DEBUG
    }
    

    
    
        
            log/app.log
    
            
                log/app.%d{dd-MM-yyyy}.log
                60
            
    
            
                %d [%thread] [%class] %5p - %m%n
            
        
    
        
            
        
    
    

    trait test extends com.weiglewilczek.slf4s.Logging {
      def logIt() {
        logger.info("this logs fine")
      }
    }
    

提交回复
热议问题