Hi,
Hmm, you want to be careful with this pattern.  I like the private
static one for Loggers -- there are very good reasons it's the
recommended pattern (by log4j, by the java.util.logging folks) and the
one that's used (by Tomcat and most other serious apps I know of).

If you really want to stick with your "base class gets the logger"
pattern, consider marking it as transient.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Antony Paul [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 15, 2004 8:27 AM
>To: Tomcat Users List
>Subject: Re: Serializable Logging implementation
>
>I extend a base form which gets the Log as
>LogFactory.getLog(this.getClass());
>So that no need to define and get a Log instance in subclass. Is there
any
>way so that I can follow this pattern.
>
>rgds
>Antony Paul
>
>----- Original Message -----
>From: "Tim Funk" <[EMAIL PROTECTED]>
>To: "Tomcat Users List" <[EMAIL PROTECTED]>
>Sent: Wednesday, September 15, 2004 4:38 PM
>Subject: Re: Serializable Logging implementation
>
>
>> logging instances should be static to the class.
>>
>> // Commons logging example but a log4j equiv should be easy to find
>>      private static Log log = LogFactory.getLog(MyClass.class);
>>
>>
>> -Tim
>>
>> Antony Paul wrote:
>>
>> > Hi,
>> >     I used Log4J and commons logging in an ActionForm which is
stored
>in
>the
>> > session. When I reload the context it is invalidating the session
>because it
>> > is non serializable. Is there any work around for this ?. Or do I
have
>to
>> > use any other Logger.
>> >
>>
>> ---------------------------------------------------------------------
>> 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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to