aspose file tools*
The moose likes Java in General and the fly likes Log.getLogger() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Log.getLogger()" Watch "Log.getLogger()" New topic
Author

Log.getLogger()

Matt Zollinhofer
Ranch Hand

Joined: Jul 09, 2004
Posts: 33
I'm trying to be good about using logging the best way as I start a new web app. I remember someone telling me that I should use LogFactory.getLogger(String) rather than LogFactory.getLogger(Class), but I don't remember why or if I believed them :-).

Can anyone elaborate on the difference (if any) between the two methods. It seems to me that using the String might be a little faster because the LogFactory wouldn't have to waste time translating the Class into a String. It seems safer to me to use the Class in case packages change (which I realize isn't all that common). Those are the only two differences I can think of. If I'm right and using the String is faster, then I'd probably do that but I'd be interested to know how much of an impact it really has.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log.getLogger()
 
Similar Threads
What is faster: accessing methods directly or using reflection?
lock question (regarding client ID
inheritance homework assignment - im stuck
What's Best/Fastest way to read random parts of a file?
(Regex + CharSequence) VS (Regex + StringBuffer) VS (startsWith + StringBuffer)