logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Blok, Eelke" <eelke.b...@numico.com>
Subject RE: NPE from DOMConfigurator.configureAndWatch
Date Tue, 14 Nov 2006 10:28:22 GMT
Hi Chris,

Looks like something is going wrong in the functionality that checks the
configuration file for changes (what exactly would be the next nut to
crack). Have you tried using configure() instead of configureAndWatch()?

Best regards,

Eelke Blok

-----Original Message-----
From: Chris Cheshire [mailto:cheshirator@gmail.com] 
Sent: dinsdag 14 november 2006 0:26
To: Log4J Users List
Subject: Re: NPE from DOMConfigurator.configureAndWatch


Can anyone help shed some light on this please?

On 11/7/06, Chris Cheshire <cheshirator@gmail.com> wrote:
> Hi,
>
> I am using log4j 1.2.13 in a web app deployed on SJAS 9. The logging 
> is initialised in a ServletContextListener subclass in the 
> contextInitialised method.
>
>         String configFile = 
> context.getInitParameter("log4j.config_file");
>
>         try {
>             DOMConfigurator.configureAndWatch(configFile, 30000L);
>         }
>         catch (Exception ex) {
>             throw new RuntimeException("unable to initialise log4j",
ex);
>         }
>
> This all works fine until I actually change the log4j config file, and

> then I see
>
> [#|2006-11-07T12:28:24.284-0800|WARNING|sun-appserver-pe9.0|javax.ente
>
rprise.system.stream.err|_ThreadID=49;_ThreadName=Thread-54;_RequestID=8
b96aeb3-efe4-4c1b-8b6c-4222c1d99332;|
> java.lang.NullPointerException
>         at
org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:168)
>         at
org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:861)
>         at
org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.jav
a:88)
>         at
org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:107)
> |#]
>
> in the server log, one of these for each appender in the log file. 
> Logging is subsequently broken and any further attempts yield errors 
> stating that I am trying to write to a closed appender and I have to 
> redeploy the web app for it to work again.
>
> How do I fix this?
>
> Thanks
>
> Chris
>

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



PRIVACY: The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential and/or
priviliged material. Any review, retransmission, dissemination or other
use of this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact
the sender and delete the material from any computer. Thank you.




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


Mime
View raw message