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: Log4j and Serializable classes
Date Tue, 23 Jan 2007 05:35:13 GMT
At 10:13 AM 1/22/2007, you wrote:
 >Hi,
 >
 >Log4j works in objects that implements Serializable?
 >
 >If so, how this is possible? If a client receives an object from the
 >server that
 >implements Serializable, how the client knows how to interpret log4j
 >instructions?
 >

Log4j Loggers are not Serializable.  You must make them either static 
variables or make them transient.  If it's static, then you don't 
need to do much else.  If it's transient, then you'll need to make 
sure you re-initialize the instance in readObject(), otherwise it 
will be null (or default value if it's a primitive) in the 
deserialized object.  I suggest you read up on serializtion....

http://www.churchillobjects.com/c/11009.html


Jake

 >Sincerely,
 >Pedro
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
 >For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message