aspose file tools*
The moose likes Other Open Source Projects and the fly likes Log4J questions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4J questions?" Watch "Log4J questions?" New topic
Author

Log4J questions?

Paul Rhoades
Greenhorn

Joined: Aug 01, 2002
Posts: 20
I'm about to start a project using Log4J and have a few questions...
a) Is it a good idea to have lots of loggers? I've read that people often create a logger for each class, but is this really efficient?
b) I'm guessing that an AsynchAppender is more efficient as it performs formatting in a separate thread, but is it resilient? What if the logger thread dies, do the messages get lost?
c) Any real does and don't for a performant and robust solution...
Thanks,
Paul.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
When i use log4j i normaly write my own logger class from which i let all my classes extend. The advantage in this case is, that i so can write the
class name to the log file. Otherwise i would have to do that manually. But so each logging entry has the class name as an identifier.
This is what worked best for me.
 
Don't get me started about those stupid light bulbs.
 
subject: Log4J questions?