Filtering out log4j messages from third-party frameworks?

后端 未结 4 540
粉色の甜心
粉色の甜心 2020-12-04 18:14

How do I filter log messages from external third party frameworks? I am using Hibernate and Spring framework and I would like to suppress the logs so that only my log4j logs

4条回答
  •  感动是毒
    2020-12-04 18:25

    In log4j.properties you can define individual levels on a per logger basis:

    log4j.logger.=FATAL
    

    In log4j.xml the syntax is

    
       
    
    

    is often the full qualified classname. You might want to use WARN or ERROR instead of FATAL

提交回复
热议问题