commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Yu <j...@scioworks.com>
Subject RE: [Logging] Thread safety guaruntee of Log classes?
Date Thu, 12 Dec 2002 02:35:39 GMT

Perhaps this should be added to the doco?

"Thread Safely - Common Logging doesn't impose any requirement on thread 
safety on the underlying implementation and thus its API contract doesn't 
guarantee thread safety. However, Commons Logging can be safely used a 
multi-threaded environment as long as the underlying implementation is 
thread-safe."

--
John


At 02:12 am 12-12-2002, you wrote:
>I guessed that.  However one should program to the API contract.  One
>benefit of using the Commons Logging API wrapper layer was to allow
>switching implementations.  If you are assuming thread safety as Struts
>seems to be, then switching to a non-thread safe implementation would break
>your application.
>
>So, is the contract of Log supposed to guarantee thread-safety?  Despite
>what Struts assumes I'll assume no until I hear otherwise.
>
>
> > -----Original Message-----
> > From: Scott Sanders [mailto:ssanders@nextance.com]
> > Sent: Wednesday, December 11, 2002 12:58 PM
> > To: Jakarta Commons Users List
> > Subject: RE: [Logging] Thread safety guaruntee of Log classes?
> >
> >
> > Since commons-logging is just a wrapper to another logging
> > implementation (ie log4j, logkit, jdk14, etc), it is my belief that if
> > the underlying logger is thread safe, then commons-logging is also
> > thread safe.
> >
> > IMHO, of course.
> >
> > Scott
> >
> > > -----Original Message-----
> > > From: Jerome Jacobsen [mailto:jerome.jacobsen@gentootech.com]
> > > Sent: Wednesday, December 11, 2002 8:53 AM
> > > To: Jakarta-Commons-User
> > > Subject: [Logging] Thread safety guaruntee of Log classes?
> > >
> > >
> > > Struts framework classes make heavy use of Commons Logging.
> > > However they always declare their Log instances as static
> > > member variables.  I am currently in the processing of moving
> > > from the Log4J API to Commons Logging. In Log4J the Category
> > > is thread-safe.  Is there any guarantee that a Commons Log
> > > instance is thread-safe?  I see nothing related to
> > > thread-safety in the API docs.  If not, then why is Struts
> > > assuming thread-safety?
> > >
> > > jerome.jacobsen@gentootech.com
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:commons-user-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <mailto:commons-user-help@jakarta.apache.org>
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
><mailto:commons-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:commons-user-help@jakarta.apache.org>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:commons-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-user-help@jakarta.apache.org>

-- 
John Yu                       Scioworks Technologies
e: john@scioworks.com         w: +(65) 873 5989
w: http://www.scioworks.com   m: +(65) 9782 9610

Scioworks Camino - "Don't develop Struts Apps without it!"
Copyright (c) 2002 John Yu/Scioworks Technologies. All rights reserved.


Mime
View raw message