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 "Leser, Ulf" <UL...@ubis-ag.com> on 2002/02/06 10:26:58 UTC

Question on multiple hierarchies and DOMConfigurator

Hello,

We have a problem with multiple hierarchies and the DOMConfigurator.

We first used multiple hierarchies using the PropertyConfigurator, following the example given in SocketServer. It all worked fine.

However, we now try to move to the DOMConfigurator. Here we get a problem - LOG4J says that no appender is configured for the root category. 

The XML file we tried is below. We used this file with the default hierarchy, and there it worked fine. Somehow LOG4J doesn't seem to relate the category defined by the <root> - tag to the manually created root category (using spi.RootCategory as in SocketServer).

Any clues why this could be ? Any help is highly appreciated.

Regards,

Ulf 

----------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

	<appender name="editor" class="org.apache.log4j.FileAppender">
           <param name="File" value="editor.log" />	
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
		    value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
           </layout>	    
	</appender>
	
	<appender name="root" class="org.apache.log4j.ConsoleAppender">
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
		    value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
           </layout>	    
	</appender>

	<category name="Editor">
	  <priority value="debug" />
  	  <appender-ref ref="editor" />
	</category>
	
	<root>
	   <priority value ="debug" />
   	   <appender-ref ref="root" />
	</root>
	
</log4j:configuration>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>