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?
posted 6 years ago
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.