This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j.xml logger name" Watch "log4j.xml logger name" New topic

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.

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

Is this good design?

Carol Enderlin
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.

jQuery in Action, 2nd edition
subject: log4j.xml logger name