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: [HELP] Urgent help on log4j Appenders being nullified
Date Fri, 25 May 2001 18:16:30 GMT
At 15:30 24.05.2001 +0100, you wrote:

>ok, found the problem. 
>apparently one of my server container classes had a finalize method defined, that called
shutdown on its category, which shutdwon all the appenders in that hierarchy.  so now i jhust
need to find why its gc'ing the server container object (for no rightful reason).

That's a definite bug in the server container code! 

In Java any instance of a class can invoke a static method of its class. In particular, any
org.apache.log4j.Category instance can invoke the shutdown (static) method of the Category
class. However, shutdown acts on the whole category hierarchy which is probably not what you
want. Regards, Ceki 

>interesting lesson of pulling hair out for an afternon though. 
>-----Original Message----- 
>From: John Waugh [<mailto:JWaugh@redfig.com>mailto:JWaugh@redfig.com] 
>Sent: 24 May 2001 14:09 
>To: Log4j-User (E-mail) 
>Subject: [HELP] Urgent help on log4j Appenders being nullified 
>As I've said in my previous mails (to little avail) I keep getting complaints from log4j
about the fact that there are no appenders on my categories, so I wrote a couple of functions
that will take a category and search the hierarchy for appenders, if they find one, they will
add it to this category, so it has an appender (so I should get no complaints!!). did that,
still got complaints.
>so I opened up log4j and looked at the src. 
>in the cateogry.callAppenders fn, the point where the complaint was comping from  it turns
out writes was 0, meaning it had checked the hierarchy for parent etc... category appenders
(as near as makes no difference for the sake of this arg), found none, so hadn't written the
log to any log files.
>now the interesting part. 
>It seems every time i run my program the complaint comes from logging in one of two threads.
not necessarily the same one each time i run the program.
>so, i write out the memory addresses of the category being made, the appenders added to
it, and the categories and appenders being checked when it calls callAppenders.  It turns
out that although when created the categories in both threads have valid references, and appenders
with valid references added to them, after the complinat (which happens early on in the program
life) one of the threads categrories has the same references (hardly expected to change) but
now the appenders are all null.
>I never set them to null, so any idea why this happens? 

Ceki Gülcü

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

View raw message