Sorry, ignore the "new".  Typo.

The reason I assumed caching is that is the behavior I'm seeing; I can
reconfigure logging yet the client invocation behavior, when using a static
class category, is unaffected.

Note, in the test case I'm looking at, that client is a stateless session
EJB.  Based on your responses, I now wonder if I'm seeing an artifact of the
container.  But I am seeing it.

> -----Original Message-----
> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 26, 2001 4:14 PM
> To: LOG4J Users Mailing List
> Subject: Re: cached category coherency
> 
> 
> At 15:25 26.03.2001 -0600, Johnson, Clay wrote:
> >Hello,
> >
> >It is conventional, based on log4j examples, to declare static class
> >variables to hold the instance of a category named for that class:
> >
> >                package foo.bar;
> >                class myClass {
> >                        static Category myCategory = new
> >Category.getInstance(myClass.class.getName());
> >                        ...
> >                }
> 
> It's 
> 
> static Category myCategory = Category.getInstance(myClass.class);
> 
> or equivalently
> 
> static Category myCategory = 
> Category.getInstance(myClass.class.getName());
> 
> There is no "new".
> 
> >It occurs to me that this is essentially a local cache of 
> configuration
> >information from the hierarchy hash table, and unless there is some
> >provision for updating it, in the event of reconfiguration 
> it is stale.
> >Indeed, Category fields, such as priority and aai, that 
> control logging
> >behavior are in that cache.
> 
> Clay,
> 
> The category reference is not a cache, it's the real thing. 
> So if it gets updated then it is reflected in the category object. 
> 
> 
> >There are various ways to deal with this.  My question is, is there a
> >"standard" approach within log4j?
> 
> No, since there is no need. I wonder what made you think that 
> the returned object was a cache. Ceki
> 
> 
> 
> I hope to see you at my ApacheCon 2001 presentation 
> entitled "Log4j, A Logging Package for Java".
> 
> See http://ApacheCon.Com/2001/US/ for more details.
> 
> --
> Ceki Gülcü          Web: http://qos.ch     
>                 email: [EMAIL PROTECTED] (preferred)
>                          [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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

Reply via email to