简体   繁体   English

java log4j INFO级别问题

[英]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. 在类中的其他任何地方都未引用Logger。

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. 此外, slf4j和/或带有logback是较新的首选日志记录库。

You can change the logging level by doing the following: logger.setLevel(Level.INFO); 您可以通过执行以下操作来更改日志记录级别: logger.setLevel(Level.INFO);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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