> -----Original Message----- > From: Matt Raible [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 06, 2002 1:34 PM > To: [EMAIL PROTECTED] > Subject: Best Practices for Logging? > > > I'm wondering what is considered the best practice for logging using > commons-logging in a Struts app. My current approach is to > have a Base > class in every package that has the following: > > protected Log log = > LogFactory.getLog("my.package.name"); > > But I've noticed that some of the Struts examples have an instance of > this in every class.
Personally I prefer the class level. This provides you with a finer grain of control. However, I restrict it to only one per class and not one per object public class Foo { private static Log log = LogFactory.getLog(Foo.class); .. } > Is this recommended, so that logging > can be done > on a class level, as well as a package level? Any thoughts/opinions > are appreciated. > > Thanks, > > Matt Sri > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>