I have written a wrapper class that implements Configurator that wraps 
ConfigureAndWatch.
Than used the DefaultInit method described in 
http://jakarta.apache.org/log4j/docs/manual.html#defaultInit 
I have also introduced a property so I am able to set the watch time at start time. 
Not that convenient as with the xml but sufficient for me.

If you like code please let me know.

Ceki: Is that interesting as a contribution to log4j?

Regards
Frank-Olaf Lohmann



>>> [EMAIL PROTECTED] 25.06.2002  18.04 Uhr >>>
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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



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

Reply via email to