wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes log4j.xml logger name 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.xml logger name" Watch "log4j.xml logger name" New topic
Author

log4j.xml logger name

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
In every example I can find, a logger "name" references a package - ex. com.foo.

What if I want to give the logger an arbitrary name so that any class can call a logger?

Is this good design?

Thanks
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Have you read the log4j short manual where it discusses the advantages of a hierarchical naming convention for loggers?

At a very minimum use of different logger names helps me decipher where the logging comes from when trying to troubleshoot an issue from the logs (without the performance hit of logging more detailed information about class or other location information). It is useful to apply different logging levels to different loggers and to route different messages into different destinations.

Of course, it is OK to use another naming system that fits your needs.



 
Don't get me started about those stupid light bulbs.
 
subject: log4j.xml logger name
 
Similar Threads
log4j category
Logging Package Specific logs using LOG4J
how to debug log4j
Can one set System property programmatically?
How to encapsulate Logger info