logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Adding isConfigured method to LoggerRepository interface
Date Wed, 28 Aug 2002 14:22:09 GMT

In the past, developers have often complained about the difficulties
of determining whether log4j has been already configured. One possible
way is to check whether the root logger has been configured. For

Logger root = Logger.getRootLogger();
boolean rootIsConfigured = root.getAllAppenders().hasMoreElements();

The slight problem with this technique is that log4j may be configured
without this being visible at the root logger level.

I propose that in log4j 1.2.7 we add the isConfigured method
(returning a boolean) in to the LoggerRepository interface. Users
would then write


to check whether log4j was already configured or not.

Existing configurators would call loggerRepository.setConfigured(true)
when configuring log4j. User code would also have the possibility to
call this method.


To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message