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 Tim Dawson <ti...@notiva.com> on 2002/06/25 20:04:42 UTC

setting watch period in settings or config

You can set the config file from a system property. You can set the
internal log4j debug from a system property or from within the config
file.  But if you want to configure and watch, you have to do that from
within the code.

The problem with this is in J2EE environments, you may have one external
log4j.xml file for the server, and multiple .ear files. If you have to
write code to start it up, you end up using something like a startup
servlet, having to deal with what happens when the .ear file is
reloaded, etc. It's a lot simpler (and more desirable) to simply handle
this with the external configuration file.

For example, you could put it in the log4j.xml file along side the debug
attribute of the log4j:configuration element, i.e.

<log4j:configuration debug="true"
                     watchDelay="60"
                     xmlns:log4j="http://jakarta.apache.org/log4j/">
 ...
</log4j:configuration>

Or you could put it in the system parameters, e.g.
 java -Dlog4j.watchDelay=60

Perhaps this has been discussed previously and there are reasons for not
doing it... but it seems like something that would be universally
desirable. Am I missing something?

---
Tim Dawson                 office: 952.941.8278x13
Lead Technical Architect   mobile: 612.384.5729
Notiva Corporation         fax:    952.941.4596

Notiva - optimizing trade relationships

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>