On Fri, 2003-12-12 at 10:59, Shimi Avizmil wrote:
> First of all thanks for the reply !
> 
> Problem 1:
> private Log log = MySystem.getLog(getClass().getName());
> 
> I'm not talking about gc the logger, I'm talking about a case where if I have an 
> object that has a static logger reference, and this object is not used anymore, will 
> this object get gced? I don't think so...if it won't, I don't think it's a good 
> practice to keep a static reference. 
> 

When you have:

private static final Logger LOG = Logger.getLogger(TheClass.class);

The LOG instance is kept with the _class_ and not with the instance of
the class, and hence will have no bearing on the GC'ing of the
instance(s).

Each instance does not hold onto refs of static vars, but has access to
them when needed via it's Class instance.

> I'm still not clear about this one. I saw in one of the archive messages that 
> changing the appenders is not supported, is this true?

I tweak the appenders of our App through a property file all the time,
and it dynamically closes, creates a new appender and configures it
without a server restart.  I do this a lot.  It's not a problem.

Paul


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

Reply via email to