10 messages in org.apache.logging.log4j-userRE: configureAndWatch
FromSent OnAttachments
Lutz MichaelJun 11, 2004 12:08 pm 
Ceki GülcüJun 11, 2004 12:24 pm 
Adrian BeechJun 11, 2004 4:34 pm 
Shapira, YoavJun 14, 2004 7:24 am 
Lutz MichaelJun 14, 2004 8:15 am 
Henrik BentelJun 14, 2004 8:55 pm 
Ceki GülcüJun 15, 2004 2:19 am 
Ceki GülcüJun 15, 2004 4:35 am 
Shapira, YoavJun 15, 2004 6:01 am 
Shirish GoelJun 16, 2004 4:30 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: configureAndWatchActions...
From:Shapira, Yoav (Yoav@mpi.com)
Date:Jun 15, 2004 6:01:12 am
List:org.apache.logging.log4j-user

Hi, We've done the servlet that reloads the log4j thing in the past: it works well,
and there's one for your use in the log4j-sandbox.

In the J2EE Spec world (which as others point out has serious limitations in
this area), the thread creation itself is just as much a problem as the lack of
a shutdown method. It's simply against the spec, so technical if you do it your
app isn't J2EE-compliant ;) Of course, in practice everyone does it all the time
in all the containers, but the user originally did ask for the strict spec take
on this.

Ceki's absolutely right that the lack of a clean shutdown for configureAndWatch
leads to bad situations with webapp reloads: we see such questions posted almost
daily on the tomcat mailing lists. One suggested solution is to take log4j's
watchdog class (in the helper package), extend it with a nice shutdown method,
and keep a referece to it in your ServletContextListener. Then you can at least
shut it down cleanly and not affect webapp reloads.

Yoav Shapira Millennium Research Informatics

-----Original Message----- From: Ceki Gülcü [mailto:ce@qos.ch] Sent: Tuesday, June 15, 2004 7:36 AM To: Log4J Users List Subject: Re: configureAndWatch

At 01:31 PM 6/16/2004, you wrote:

Hi Ceki,

Is there any other way, we can dynamically reload the properties file in a J2EE app,

A good way is to write a servlet that reloads the log4j config when called.

Regards..

----- Original Message ----- From: "Ceki Gülcü" <ce@qos.ch> To: "Log4J Users List" <log4@logging.apache.org> Sent: Tuesday, June 15, 2004 2:49 PM Subject: RE: configureAndWatch

Yoav,

The problem is not the thread itself, but the fact that once started it cannot be stopped until the JVM exits. configureAndWatch does not provide a means to close the thread. Imagine the problems when the web-app is recycled and you have multiple configureAndWatch threads running amok. It does not make a pleasant sight.

HTH,

At 04:24 PM 6/14/2004, you wrote:

Hi, Read the J2EE Specification guidelines on spawning user threads within a container to understand why. configureAndWatch spawns a thread, albeit a daemon, to watch the file.

Yoav Shapira Millennium Research Informatics

-----Original Message----- From: Adrian Beech [mailto:a.be@bigpond.net.au] Sent: Friday, June 11, 2004 7:35 PM To: 'Log4J Users List' Subject: RE: configureAndWatch

G'day,

Could you possibly explain as to why this is so?

AB

-----Original Message----- From: Ceki Gülcü [mailto:ce@qos.ch] Sent: Saturday, 12 June 2004 5:25 AM To: Log4J Users List Subject: Re: configureAndWatch

Hello Mike,

It is *not* OK to use configureAndWatch in a web-app.

At 09:09 PM 6/11/2004, you wrote:

Is it OK to use configureAndWatch in a Servlet?

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp