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 Paul Duffy <pa...@cisco.com> on 2007/11/13 22:58:59 UTC
Forcing XML configuration file to reset Log4J configuration
Folks,
Been bit by the incremental nature of XML configuration application. Is
there any way to not apply a changed XML configuration incrementally,
but instead force full reset to reflect the state of the configuration file?
Cheers
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Forcing XML configuration file to reset Log4J configuration
Posted by Curt Arnold <ca...@apache.org>.
On Nov 13, 2007, at 3:58 PM, Paul Duffy wrote:
> Folks,
>
> Been bit by the incremental nature of XML configuration
> application. Is there any way to not apply a changed XML
> configuration incrementally, but instead force full reset to
> reflect the state of the configuration file?
>
> Cheers
>
log4j 1.2.15 and later support a reset attribute on the
log4j:configuration element:
<log4j:configuration reset="true">
See http://issues.apache.org/bugzilla/show_bug.cgi?id=17531
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Forcing XML configuration file to reset Log4J configuration
Posted by Paul Duffy <pa...@cisco.com>.
Thanks Matthew.
We're talking about a JBoss environment using the configureAndWatch type
of mechanism to pick up the XML configuration changes.
There is no way to fully reset and reload the configuration w/o
restarting the logging service?
Matthew Kemp wrote:
> To reset an entire configuration you need something like this:
>
> public void reloadLog4J() {
> LogManager.resetConfiguration();
> DOMConfigurator.configure("log4j.xml");
> }
>
> Unfortunately, even the DOMConfigurator.configureAndWatch() only does
> an incremental reload.
>
>
> Matt
>
>
> On Nov 13, 2007 3:58 PM, Paul Duffy <paduffy@cisco.com
> <ma...@cisco.com>> wrote:
>
> Folks,
>
> Been bit by the incremental nature of XML configuration
> application. Is
> there any way to not apply a changed XML configuration incrementally,
> but instead force full reset to reflect the state of the
> configuration file?
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> <ma...@logging.apache.org>
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> <ma...@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: Forcing XML configuration file to reset Log4J configuration
Posted by Matthew Kemp <ma...@gmail.com>.
To reset an entire configuration you need something like this:
public void reloadLog4J() {
LogManager.resetConfiguration();
DOMConfigurator.configure("log4j.xml");
}
Unfortunately, even the DOMConfigurator.configureAndWatch() only does an
incremental reload.
Matt
On Nov 13, 2007 3:58 PM, Paul Duffy <pa...@cisco.com> wrote:
> Folks,
>
> Been bit by the incremental nature of XML configuration application. Is
> there any way to not apply a changed XML configuration incrementally,
> but instead force full reset to reflect the state of the configuration
> file?
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>