tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Serializable Logging implementation
Date Wed, 15 Sep 2004 12:35:17 GMT

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 []
>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
>So that no need to define and get a Log instance in subclass. Is there
>way so that I can follow this pattern.
>Antony Paul
>----- Original Message -----
>From: "Tim Funk" <>
>To: "Tomcat Users List" <>
>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
>> > 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
>> > use any other Logger.
>> >
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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:
For additional commands, e-mail:

View raw message