RE: Serializable Logging implementation

2004-09-17 Thread Shapira, Yoav
Hi, OP = Original Poster, the person who started this thread. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Antony Paul [mailto:[EMAIL PROTECTED] >Sent: Friday, September 17, 2004 9:31 AM >To: Tomcat Users List >Subject: Re: Serializable Logging

Re: Serializable Logging implementation

2004-09-17 Thread Antony Paul
What is OP ? Can you please expand it ? rgds Antony Paul - Original Message - From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Friday, September 17, 2004 5:41 PM Subject: RE: Serializable Logging implementatio

Re: Serializable Logging implementation

2004-09-17 Thread Tim Funk
static variables are not serialized because they are not "part of the object instance being serialized". (Can thing of a better phrasing) -Tim Spiegs wrote: Ok, in a nutshell - using a private static logger in each model object will not be serialized across the cluster. Use the following 3 lines

RE: Serializable Logging implementation

2004-09-17 Thread Shapira, Yoav
Hi, >Ditch the super class philosphy. And copy the following 3 lines of code: >import ... LogFactory; >import ... Log; >private static log = LogFactory.get...(My.class); Yup, exactly. Tim's message is right on, and if you look at the start of this thread you see we only started suggesting the a

Re: Serializable Logging implementation

2004-09-16 Thread QM
On Thu, Sep 16, 2004 at 07:49:17PM -0500, Spiegs wrote: : What is the best approach for someone starting a new app? Is having all : of your model objects contain a transient static log instance, implement : Serializable, and implement HttpSessionActivationListener to : reinstantiate the log inst

Re: Serializable Logging implementation

2004-09-16 Thread Spiegs
Ok, in a nutshell - using a private static logger in each model object will not be serialized across the cluster. Use the following 3 lines of code you provided and I won't have any problems with the log4j log instance not being serializable, because it never will be. Right? (I'm not familiar w

Re: Serializable Logging implementation

2004-09-16 Thread Tim Funk
h a clean slate? If you were to put the above code into a superclass, doesn't that go against the previously discussed advice of having the log instance belong to each class? Thanks, Eric Original Message -- Subject: Re: Serializable Logging implementation From: Tim Funk <

Re: Serializable Logging implementation

2004-09-16 Thread Spiegs
- Original Message - From: "Tim Funk" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 4:38 PM Subject: Re: Serializable Logging implementation logging instances should be static to the class. // Commons lo

Re: Serializable Logging implementation

2004-09-15 Thread Jacob Kjome
Quoting Tim Funk <[EMAIL PROTECTED]>: > 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); > or private transient Log log = LogFactory.getLog(MyClass.class); Al

Re: Serializable Logging implementation

2004-09-15 Thread Tim Funk
t;Tim Funk" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:50 PM Subject: Re: Serializable Logging implementation Your NPE comes from the transient value not being restored from de-serialization. Your best chance at

Re: Serializable Logging implementation

2004-09-15 Thread Antony Paul
o: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:33 PM Subject: RE: Serializable Logging implementation Hi, Then no one can help you if you don't give any details ;) Stack trace? Config details? Have you done any debugging of your own? NPEs u

Re: Serializable Logging implementation

2004-09-15 Thread Antony Paul
AIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:50 PM Subject: Re: Serializable Logging implementation > Your NPE comes from the transient value not being restored from de-serialization. > > Your best chance at this poin

Re: Serializable Logging implementation

2004-09-15 Thread Antony Paul
o: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:33 PM Subject: RE: Serializable Logging implementation Hi, Then no one can help you if you don't give any details ;) Stack trace? Config details? Have you done any debugging of your own? NPEs u

Re: Serializable Logging implementation

2004-09-15 Thread Tim Funk
Message - From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:05 PM Subject: RE: Serializable Logging implementation Hi, Hmm, you want to be careful with this pattern. I like the private sta

RE: Serializable Logging implementation

2004-09-15 Thread Shapira, Yoav
son? It's repeated at least once a day on this list ;) Yoav Shapira Millennium Research Informatics >-Original Message- >From: Antony Paul [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 15, 2004 9:04 AM >To: Tomcat Users List >Subject: Re: Serializable Log

Re: Serializable Logging implementation

2004-09-15 Thread Antony Paul
Then it throws NullPointerException rgds Antony Paul - Original Message - From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 6:05 PM Subject: RE: Serializable Logging implementation

RE: Serializable Logging implementation

2004-09-15 Thread Shapira, Yoav
: Tomcat Users List >Subject: Re: Serializable Logging implementation > >I extend a base form which gets the Log as >LogFactory.getLog(this.getClass()); >So that no need to define and get a Log instance in subclass. Is there any >way so that I can follow this pattern. > >rgds >A

Re: Serializable Logging implementation

2004-09-15 Thread Antony Paul
o: "Tomcat Users List" <[EMAIL PROTECTED]> 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 >

Re: Serializable Logging implementation

2004-09-15 Thread Tim Funk
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 stored in the session. When

Serializable Logging implementation

2004-09-15 Thread Antony Paul
Hi, I used Log4J and commons logging in an ActionForm which is stored in the 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 have to use any other Logger. rgds Antony Paul --