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
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
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
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
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
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
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 <
- 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
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
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
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
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
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
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
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
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
: 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
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
>
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
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
--
20 matches
Mail list logo