logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: is Logger serializable?
Date Thu, 03 Apr 2003 01:22:01 GMT

If you make them class static variables, it is the same as marking them as 
transient.  The recommended way to define a logger is probably....

private static final Logger logger = Logger.getLogger(MyClass.class.getName());

This will not be serialized.  If you don't make it static, then do...

private transient final Logger logger = 
Logger.getLogger(DBRApplicationGateway.class.getName());


Jake

At 06:03 PM 4/2/2003 -0600, you wrote:
>Hello -
>
>I am a brand new log4j user so this is probably a stupid question, but is a
>Logger meant to be serializable? Or should I mark Logger instance variables
>in my serializable bean classes as transient? The Serializable interface
>isn't on Logger.
>
>Thanks,
>------------------------------------------------------
>Anna Battenhouse
>Internet Applications Architect
>CCITRIAD, Inc.
>804 Las Cimas Parkway, Suite 200
>Austin TX 78746
>(512) 278-5524
>anna.battenhouse@ccitriad.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message