Avoid configureAndWatch() like the plague.  Instead, use a tool like LogWeb...

http://www.codeczar.com/products/logweb/index.html

Jake

Quoting Philip Denno <[EMAIL PROTECTED]>:

> There is a mechanism called configureAndWatch (look in the javadoc) which
> checks if file has been changed recently, but I think it's use is discouraged
> because it was not thread safe.
>
> Would it be possible for you to build a web interface which would allow you
> to programmatically change the logging level while the application is
> running? I run inside Tomcat and this is the solution I use.
>
> Cheers,
> Philip.
>
> -----Original Message-----
> From: Oliver Schoenwald [mailto:[EMAIL PROTECTED]
> Sent: January 31, 2006 2:42 AM
> To: [email protected]
> Subject: Automatic reload of xml configuration file under Tomcat 5.5.4
>
>
> Hi there,
>
> we are using Tomcat 5.5.4 with log4j 1.2.7. Up to now we used a log4j
> property-file with the key-value property-syntax.
> Now we have to use the nice filter-feature of log4j and so I have
> switched to the xml-variant of log4j properties.
> So far it works fine. We get all loggers writing to our appenders, the
> filters are working (even our self-written) etc. etc.
>
> So, why am I writing to this list?
>
> When we used the key-value-type property-file, Tomcat reloaded that file
> after some time (I think after about 1 minute).
> After I have changed to the xml-type property-file, the properties are
> no longer reloaded. Up to now we could change
> the log-levels of our loggers without restarting our servlet-engine
> (which is quite important). With the xml-file it seems
> that we have to restart the engine to make it load the new log4j
> configuration.
>
> I would like to have the xml-configuration file being reloaded similar
> to the former key-value-configuration file. How do
> I set this up?
>
> So far I see only one solution: writing my own filter which is working
> similar to the LevelRangeFilter but doesn't take
> its min- and max-Level by configuration-params but from another
> key-value property-file which is reloaded automatically
> after some time.
>
> Should I do this or is there a simpler solution for my problem?
>
> Thank your for any help in advance!
>
> Oliver Schönwald
> University of Hagen, Germany
>
> ---------------------------------------------------------------------
> 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]
>




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

Reply via email to