Loading...

log4j-user@logging.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: What are configuration reload defaults? Curt Arnold Wed Feb 11 20:00:33 2009


On Feb 11, 2009, at 9:52 AM, Steve Cohen wrote:

I have been all over the documentation and I can't find something that
tells me succinctly what the DEFAULT behavior in regard to configuration
reloading (PropertyConfigurator.configureAndWatch() or
DOMConfigurator.configureAndWatch()) is. My question assumes a non- J2EE
java application.

Assuming that I do not call these methods from my code but simply drop a
new log4j configuration file into its defined location in the file
system, will the new configuration be picked up automatically, (in one
minute, if I understand the javadocs correctly)?  Or do I have to do
something (coding or configuration) for this behavior to occur?  If it
doesn't happen automatically, instead of coding, is it possible to
define through a log4j.* system property something that turns this
behavior on?

Configure and watch launches a thread that monitors file changes. If a file change is detected it will load the new configuration file. Unless the configuration file specifies a reset (log4j.reset=true or reset="true" on log4j:configuration element), the new configuration is added to the previous configuration which is an undesirable, but long established behavior.



Also, while on the subject of log4j system properties, is there a list
anywhere of all the log4j.* properties (such as log4j.debug) that log4j
responds to when defined either as system properties or in the
configuration file itself?

A list of system properties was requested as an enhancement for log4j 1.2.16 and is currently in the source for the FAQ (http://svn.apache.org/repos/asf/logging/log4j/trunk/src/site/fml/faq.fml ) near the end. That only includes system properties that are accessed independent of the configurator. It does not describe the properties read by the PropertyConfigurator.



Thank you. I really appreciate log4j but this information would be nice
to have.

Steve Cohen


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]