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 Scott Deboy <sd...@comotivsystems.com> on 2005/09/18 08:28:58 UTC

JoranConfigurator problems

I've noticed two issues with an xml-based configuration that works fine with the 1.2.x jars but does not work using log4j 1.3x alpha jars:

1. An appender that's defined but not referenced is still constructed and activateOptions is called (the IRC appender in the example below)

2. Using a 'category' instead of 'logger' node prevents the configuration from being loaded with the following error (using a 'logger' node works fine):
Reported error: "no applicable action for <category>, current pattern is [/configuration/category]" at line 27 column 24
Reported error: "no applicable action for <priority>, current pattern is [/configuration/category/priority]" at line 28 column 32
Reported error: "no applicable action for <appender-ref>, current pattern is [/configuration/category/appender-ref]" at line 29 column 30

Here is the configuration I was using:

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

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

      <appender name="IRC" class="irc.IRCAppender">
        <param name="Port" value="6667"/>
        <param name="remoteHost" value="irc.freenode.net"/>
        <param name="nickName" value="sdeboy4"/>
        <param name="userName" value="sdeboy4"/>
        <param name="channel" value="#log4j"/>
	<param name="password" value="sdeboy4"/>

        <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
		    value="%p %c %m %throwable%n"/>
        </layout>	    
      </appender>

      <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
		    value="%p %c %m %n"/>
           </layout>	    
      </appender>

      <category name="test">
        <priority value="debug"/>
	<appender-ref ref="STDOUT"/>
      </category>

	<root>
	   <priority value ="debug" />
	</root>
	
</log4j:configuration>


Scott


-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org]
Sent: Wed 9/14/2005 4:21 AM
To: log4j-dev@logging.apache.org
Subject: DO NOT REPLY [Bug 36654]  -    Provide better error messages for "Please initialize the log4j system properly"
 
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36654>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36654





------- Additional Comments From hauser@acm.org  2005-09-14 13:21 -------
Created an attachment (id=16403)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=16403&action=view)
LogManager.java.patch

This would certainly reduce the "config-problems" noise on the mailing list...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org