logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: PropertyConfigurator.configure method in J2EE
Date Tue, 02 Oct 2001 06:49:52 GMT
At 16:08 01.10.2001 -0400, David Schultz wrote:
>If I understand the documentation and discussion threads properly, the
>configure method of the PropertyConfigurator class should only be called
>once be JVM.  (Multiple calls result in multiple occurences of output data
>in the logs.)

That is not entirely correct. If a configuration file is reloaded, then any category mentioned
in the config file will have its appenders closed and removed. The duplication will not occur.

>So, when using a J2EE server, where is the appropriate place for putting the
>configure call?

Can't you define beans that are loaded at Aplicication Server initialization time?

>(From the documentation, it is clear how to setup the Tomcat servlet engine
>to only configure once.  A program with a main() is obvious.  However, about
>the only thing I have seen for J2EE is to have a stateless session bean for
>performing the configure.  I guess this would be something done by an
>administrator once the server was brought up.  However, it seems like there
>should be a cleaner way.)
>On a related note, I don't see people talking about the shutdown method of
>the Category class.  Are people just assuming that is okay to let an
>application terminate without closing any open output streams?  Again, with
>a main() this is obvious.  Although this doesn't seem to be discussed for
>Tomcat or J2EE servers.

You can use JDK 1.3 shutdown hooks. See Runtime.addShutdownHook(Thread) for more details.

Ceki Gülcü - http://qos.ch

To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message