how to log only one level with log4j2?

后端 未结 3 692
日久生厌
日久生厌 2020-12-10 07:51

I\'m using log4j2 in my application.

What I want is everything up to \'debug\' to go to console, everything up to \'info\' to go to myapp.log, and ONLY \'info\' to g

3条回答
  •  忘掉有多难
    2020-12-10 08:42

    If you specify INFO in the appender-ref, the appender will receive INFO, WARN, ERROR and FATAL events. You can further restrict to only INFO by filtering out WARN, ERROR and FATAL level events:

    
        
        
    
            
            
            
            
    
            
            
        
    
    

提交回复
热议问题