On Wed, 11 Dec 2002, Jerome Jacobsen wrote:
> Date: Wed, 11 Dec 2002 17:49:24 -0500 > From: Jerome Jacobsen <[EMAIL PROTECTED]> > Reply-To: Jakarta Commons Users List <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] > To: Jakarta Commons Users List <[EMAIL PROTECTED]> > Subject: RE: [Logging] Thread safety guaruntee of Log classes? > > > > > Declaring the Log variable static or not has zero effect on whether it is > > threadsafe or not -- it only determines whether or not the Log instance is > > shared across all instances of the declaring class. > > > > Craig > > > > Huh? Declaring the Log instance static means that it better be thread-safe. True, but you're missing an important point. Exactly the same is true for a non-static declaration. Consider a Struts Action class. Struts creates a single instance of your declared Action class, and it will be quite common to have multiple requests processing through the action at the same time (and therefore possibly triggering log calls at the same time). It makes absolutely no difference whether or not the log variable itself is declared statically. It has to be thread safe either way. Craig -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
