logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Sawatzky <jeff.sawat...@locationary.com>
Subject slf4j, log4j and PropertyConfigurator.configure
Date Wed, 06 Jun 2012 22:26:51 GMT
I have a project where I am using slf4j with the log4j binder, and I am trying to configure
log4j with the PropertyConfigurator.  The project allows for a common log4.properties file
and a machine log4j.properties file, and at start up I load the two files, combine them into
a Properties object, and then pass them to PropertyConfigurator.configure. But when I try
to log using slf4j I get a "log4j:WARN No appenders could be found for logger" error on the
class I am trying to log from.

In my app startup I have..

Properties props = //do work.......
LogManager.resetConfiguration();
PropertyConfigurator.configure(props);

but here is the output (with log4j.debug turned on)
log4j: Parsing for [root] with value=[INFO, stdout].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x - %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Finished configuring.
log4j: Parsing for [root] with value=[INFO].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Finished configuring.
log4j:WARN No appenders could be found for logger (com.loca.util.services.AppListener).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Shouldn't the logger for com.loca.util.services.AppListener use the root appender that was
configured?

Thanks!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message