开发者

java log4j INFO level problem

开发者 https://www.devze.com 2022-12-21 01:06 出处:网络
I am not sure what I could be doing wrong that causes info level messages not to appear. Here is the situation

I am not sure what I could be doing wrong that causes info level messages not to appear. Here is the situation

 class LogTest {
      protected final Logger logger = Logger.getLogger(getClass());
      ...
      public void start() {
            l开发者_如何学Cogger.error(logger.isInfoEnabled());
               logger.info("blah");
      }
      ...
  }

Logger is not referenced anywhere else in the class.

Here is the output:

 ERROR 2010-02-18 09:14:01,489 com.company.test.Test - true

I do not know what else to check in order to get info working.. according to the logger it is enabled.


You could have an appender that only acts on WARN or higher or you could have configured a filter.


Be sure that you have set the appropriate logging level. Additionally, slf4j and/with logback are the newer and preferred logging libraries.

You can change the logging level by doing the following: logger.setLevel(Level.INFO);

0

精彩评论

暂无评论...
验证码 换一张
取 消