How to create 2 different ROOT loggers with logback?

前端 未结 2 401

I\'m happily using SLF4J with logback and use 2 appenders for the ROOT logger.


    

        
2条回答
  •  离开以前
    2020-12-29 01:41

    You can have multiple root elements, each with an associated logging level and an appender-ref (I'm working with logback.version>1.0.13) In this case you also have to put a FILTER inside yours appenders, like that:

    
        true
    
    
    
    
    
    
       
         INFO
         ACCEPT
         DENY
      
      
            %-4relative [%thread] %-5level %logger{35} - %msg %n
      
      
    
    
      
         DEBUG
         ACCEPT
         DENY
      
      
          [%d{ddMMMyyyy HH:mm:ss.SS}]%-5level %logger{45} - %msg %n
      
    
    
    
    
        
    
    
        
    
    

提交回复
热议问题