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 OOMS DIRK <Ex...@siemens.be> on 2005/02/16 11:59:18 UTC
RE: JoranConfigurator problem (output is duplicated after reconfi
gure)
It will be solved if you call resetConfiguration() on your repository before
calling doConfigure()
dirk
> -----Original Message-----
> From: Arthur Brown [mailto:arthur.brown@gmx.net]
> Sent: woensdag 16 februari 2005 11:56
> To: log4j-user@logging.apache.org
> Subject: 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: JoranConfigurator problem
Posted by Arthur Brown <ar...@gmx.net>.
Hi Dirk,
thank you, now it's OK.
may be it make sence to define a new method:
doReconfigure
Ciao
Arthur
> It will be solved if you call resetConfiguration() on your repository
> before
> calling doConfigure()
>
> dirk
>
> > -----Original Message-----
> > From: Arthur Brown [mailto:arthur.brown@gmx.net]
> > Sent: woensdag 16 februari 2005 11:56
> > To: log4j-user@logging.apache.org
> > Subject: 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
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
--
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