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 Arthur Brown <ar...@gmx.net> on 2005/02/16 11:56:01 UTC

JoranConfigurator problem (output is duplicated after reconfigure)

Hello,

I'm using log4j version logging-log4j-1.3alpha-6.

If I'm trying to reconfigure JoranConfigurator then the output is
duplicated.
Every time during doConfigure is called the appender is added to logger.
So after 10 time doConfigure the output appear 10 time.

I found a message from Marc on net, where he's reporting the same  
behaviour. He is stating there, that may be a new ResetAction have to be
introduced in JoranConfigurator.

Is there a patch or workaround for this problem?
(I have to use JoranConfigurator, because I need filter for appender).

My code is:

JoranConfigurator joran = new JoranConfigurator();
joran.doConfigure(file, LogManager.getLoggerRepository());

JoranConfigurator joran2 = new JoranConfigurator();
joran2.doConfigure(file, LogManager.getLoggerRepository());

My XML file is:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
	  
<configuration threshold="warn" 
    xmlns='http://logging.apache.org/' debug="true">
	  
  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.SimpleLayout"/>
  </appender>

  <root>
    <level value="DEBUG" />
    <appender-ref ref="STDOUT" />
  </root>  

</configuration>

Thank you for help.

Ciao
Arthur

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

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