commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: LogFactory.getLog()
Date Sun, 08 Aug 2010 00:42:21 GMT
On Sat, Aug 7, 2010 at 7:28 PM, Torsten Curdt <tcurdt@apache.org> wrote:
>
> For me that's exactly the other way around - most of the time I don't
> need the static access.
>

But, if you use static, you can access the log both ways.

>
> > (log objects aren't serializable for instance)
>
> How is that a problem?
>

In Wicket, fields of your pages/components are serialized.  This is
just an example.  What about entity classes?  They're usually
serializable too.  Having a field that's a Log object would break
their serialization.  What I'm saying is that there are lots of cases
where using an instance variable doesn't work.

> > and it's inefficient.
>
> http://c2.com/cgi/wiki?PrematureOptimization
>

Trust me, I'm speaking from experience.  We've seen in our application
where switching from instance to static logs can save quite a bit of
time.  It's not a premature optimization.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message