> From: Mark Shifman [mailto:[EMAIL PROTECTED] 
> Subject: Defining loggers "best" approach?
> 
> Is there some advantage to defining the logger as private transient?

The transient attribute prevents the reference from being included in
serialization of the encapsulating object (e.g., session recovery or
beans being shared across cluster nodes).  It's a good practice to
follow for references that have no meaning outside of the local
instantiation.  Just have to remember that the field can turn up null
after deserialization.

Private just means that sub-classes can't share this logger definition,
and have to do their own.  Whether or not that's good practice depends
on your application architecture.

> Does this somehow allow avoid memory leaks where the 
> classloader cannot be garbage collected?

No.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to