You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Michael Rimov <ri...@centercomp.com> on 2001/06/01 07:26:58 UTC
Bug: Duplicate Categories in DOMConfigurator mess up Appenders
Hello All,
I'd normally report this to Bugzilla, but it's been down all day. Sorry for
the bandwidth waste.
Summary: Duplicate entries in an XML configuration file will mess up the
appenders referenced by the entries:
Severity: Mild (Easy work around - have the right config file! :-) )
Example Configuration File Snippets [Admittedly, this isn't exactly a good
file setup :-) ]
<appender name="fileLog" class="org.apache.log4j.FileAppender">
<param name="File" value="/temp/testlog.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%l) - %m\n"/>
</layout>
</appender>
<snip> ...... <snip>
<category name="a.dup" >
<appender-ref ref="expressoLog"/>
</category>
<category name="a.dup">
<appender-ref ref="expressoLog"/>
</category>
<root>
<appender-ref ref="fileLog"/>
<priority value="info"/>
</root>
What happens:
The second time the DOMConfigurator parses the category expresso.ext, it
first calls RemoveAllAppenders(). This would normally be ok, but it also
causes as a side effect for the logfile to actually be closed, and all
subsequent attempts to write to any category using the logfile will get an
error message saying that the appender is closed.
I don't understand if this is actually a bug in
DOMConfigurator.parseChildrenOfCategoryElement(),
or
Category.removeAllAppenders()
(Or something completely unrelated for that matter :))
Needless to say, I've come across the answer to my previous post.
Thanks for looking into this.
-Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org