简体   繁体   中英

java log4j INFO level problem

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() {
            logger.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.

您可能拥有仅在WARN或更高版本上起作用的追加程序,或者可以配置了过滤器。

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM