log4j rootlogger turn off logger for some classes

后端 未结 2 1263
野性不改
野性不改 2021-01-05 07:57

how can i configure a log4j.properties with a rootlogger = debug, stdout, logfile
and org.apache.httpclient = debug which goes into the logfil

2条回答
  •  無奈伤痛
    2021-01-05 08:56

    In the log4j.properties file, add the line

    log4j.logger.org.apache.httpclient=DEBUG, logfile
    

    to direct the org.apache.httpclient logger output to the logfile appender.

    Also include the line

    log4j.additivity.org.apache.httpclient=false
    

    to prevent the org.apache.httpclient logger output going to the rootLogger's appenders.

提交回复
热议问题