tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Cosenza <rob...@gmail.com>
Subject Re: commons-logging logger instances - how to initialize in replicated session objects
Date Mon, 14 Feb 2005 08:34:43 GMT
Richard, You should also be carefull with the "static" keyword if you
are using a clustered session. Its meaning is completely different
that when running in just one jvm so I would remove it to avoid
confusion.
Since you don't need to replicate the loggers, you could also define
them as "transient", so they will not be serialized during session
replication.
In my classes, I usually use a "protected transient Log logger"
declaration so you can also avoid to redeclare loggers for your
subclasses.


On Sat, 12 Feb 2005 06:43:03 -0700, Richard Mixon (qwest)
<rnmixon@qwest.net> wrote:
> Thanks Trond, I had forgotten about readObject.That may be a better
> option than creating yet another utility method.
> 
> Trond G. Ziarkowski wrote:
> > Hi,
> >
> > I'm maybe stepping out of my territory here, but I think that static
> > members are not serialized/deserialized. To re-initialize your static
> > logger maybe you should try to implement the
> > readObject(java.io.ObjectInputStream in) method from the
> > java.io.Serializable interface something like this:
> >
> > readObject(...) {
> >     super.readObject(...);
> >     log = LogFactory.getLog(...);
> > }
> >
> > Hope this is of some help
> >
> > Trond
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


-- 
Roberto Cosenza
http://robcos.com

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


Mime
View raw message