Hi Everyone!
Sometimes when i see my logging code i wonder if i do it right. There might be no definitive answer to that, but i've folling concerns:
Library Classes: I have several library classes wich might log some INFO messages. Fatal Errors are reported as exceptions. Currently i have a static logger instance in my classes with the class name as the logging name. (Log4j's: Logger.getLogger(MyClass.class))
Is this the right way? Maybe the user of this library class dont want any messages from my implementation or want to redirect them to an application specific log. Should i allow to set a logger from the "outside world"? How do you handle such cases?
General logs: In some applications my classes might want to write a log message to a specific log, not identified by the classes name. (I.e.: HTTP Request log) What is the best way to do such a thing? A loopup service comes to mind...