You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2002/09/12 12:58:34 UTC
DO NOT REPLY [Bug 12570] New: -
Problems with DOMConfigurator.configureAndWatch
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12570>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12570
Problems with DOMConfigurator.configureAndWatch
Summary: Problems with DOMConfigurator.configureAndWatch
Product: Log4j
Version: 1.2
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Minor
Priority: Other
Component: Configurator
AssignedTo: log4j-dev@jakarta.apache.org
ReportedBy: rune.johannesen@digitalrum.com
I have noticed a problem using the configureAndWatch option of the
DOMConfigurator. I suspect the same problem to apply to the
PropertyConfigurator as well.
First I run a test program logging with this initial config file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration threshold="null">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-25d{yyyy-MM-dd
HH:mm:ss.SSS} %-5p %F:%L %m%n"/>
</layout>
</appender>
<root>
<priority value="debug"/>
<appender-ref ref="console"/>
</root>
</log4j:configuration>
This works fine, all the logging statements
_logClass.info("info");
_logClass.debug("debug");
_logClass.warn("warn");
_logClass.error("error");
_logClass.fatal("fatal");
are displayed in the console.
Then I change the file to use threshold=�warn� in the log4j:configuration
element. The change applies immediately. However, if I change the file back to
threshold=�null� (and save it, of course), the change is not adopted. If I
restart the program it starts logging all the levels again.
In version 1.1.4 of Log4j the DOMConfigurator inherited a resetConfiguration
method from its superclass BasicConfigurator, which solved the problem (calling
resetConfiguration() before doConfigure()). I think the configurations need to
be reset before they are reconfigured to ensure a consistent behaviour.
Best regards
Rune Toalango Johannesen
Digital Rum Limited
264A Belsize Road
London NW6 4BT
Telephone: +44 20 76 04 20 19 (direct)
Fax: +44 20 76 04 20 01
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>