You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kris Schneider <kr...@dotech.com> on 2005/02/01 00:36:48 UTC

Re: Why is JCL thread-safe in an Action?

I'll be looking into UGLI as well, but I currently code directly to the 
log4j API. Not that it doesn't have it's own set of issues in a J2EE 
environment, but my impression is that JCL can be much worse. Here's 
something else to chew on:

http://www.qos.ch/logging/thinkAgain.jsp

Vic wrote:
> That's great about Java.
> I am going the other way, from JCL to the new log4j:
> http://logging.apache.org/log4j/docs/ugli.html
> 
> .V
> 
> fzlists@omnytex.com wrote:
> 
>> Today I find myself converting an existing webapp from using Log4J 
>> directly to using JCL instead.  As per the JCL User's Guide, I'm 
>> creating a private static Log variable in all my classes, Struts 
>> Actions included.
>>
>> My question is, why is this OK?  Static variables in Actions are a Bad 
>> Thing, that's a ell-known fact, but why is a Log instance an exception 
>> to this rule?
>>
>> Is it only a bad thing to have static members that might be updated?  
>> Is that the difference here? 
>> Thanks all!

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Re: Why is JCL thread-safe in an Action?

Posted by Kris Schneider <kr...@dotech.com>.
In the spirit of equal time:

http://wiki.apache.org/jakarta-commons/Commons_20Logging_20FUD

To summarize the last paragraph (that quotes an entry from the blog of one 
of JCL's creators), JCL is intended to be used by *library* code so it can 
leverage the logging implementation used by the application it is being 
called from. In other words, JCL is not intended to be used by applications.

Kris Schneider wrote:
> I'll be looking into UGLI as well, but I currently code directly to the 
> log4j API. Not that it doesn't have it's own set of issues in a J2EE 
> environment, but my impression is that JCL can be much worse. Here's 
> something else to chew on:
> 
> http://www.qos.ch/logging/thinkAgain.jsp
> 
> Vic wrote:
> 
>> That's great about Java.
>> I am going the other way, from JCL to the new log4j:
>> http://logging.apache.org/log4j/docs/ugli.html
>>
>> .V
>>
>> fzlists@omnytex.com wrote:
>>
>>> Today I find myself converting an existing webapp from using Log4J 
>>> directly to using JCL instead.  As per the JCL User's Guide, I'm 
>>> creating a private static Log variable in all my classes, Struts 
>>> Actions included.
>>>
>>> My question is, why is this OK?  Static variables in Actions are a 
>>> Bad Thing, that's a ell-known fact, but why is a Log instance an 
>>> exception to this rule?
>>>
>>> Is it only a bad thing to have static members that might be updated?  
>>> Is that the difference here? Thanks all!

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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