tags:

views:

49

answers:

2

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.

+4  A: 

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

Joachim Sauer
INFO is likely being filtered out in whatever logging output you're looking at (console/file). You can also set the filter by package.
Dolph
It was an appender, thanks. +1 to Dolph also since I had not considered that possibility.
insipid
+2  A: 

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

kgrad
The problem is **not** the log level of the logger, as shown by the output of the program.
Joachim Sauer