log4j debug messages not showing in console despite isDebugEnabled being true

前端 未结 2 1703
一生所求
一生所求 2021-02-07 15:18

I am using the following code within my project to log debug messages with log4j

private static final Logger LOG = Logger.getLogger(MyClass.class)
// ...
if(LOG.         


        
2条回答
  •  抹茶落季
    2021-02-07 15:56

    log4j.appender.Stdout.threshold=info
    

    Should be:

    log4j.appender.Stdout.threshold=debug
    

    You just set the console threshold to be info, so you're not getting debug level logs.

    Be aware you also set the RollingFileAppender threshold to info as @Stephen C commented.

提交回复
热议问题