How to configure log4j2.xml log level for specific class only?

前端 未结 1 1346
天命终不由人
天命终不由人 2021-01-13 14:08

In log4j it\'s possible to define log levels by package as follows:

    

        
1条回答
  •  被撕碎了的回忆
    2021-01-13 14:51

    It should work with fully qualified name as well. Logger.name doesnt have to be package/class only but it could be any name which you want to. When you call LoggerFactory.getLogger("MyLogger"), then you have to use

    
      
    
    

    Check what is logged when you use logger for package and use logger name from log. What logger name is logged for this class?

    0 讨论(0)
提交回复
热议问题