Are there any suggested ways for naming loggers?
Yes, there are. You can name logging loggers by locality. It turns out that instantiating a logger in each class, with the logger name equal to the fully-qualified name of the class, is a useful and straightforward approach of defining loggers. This approach has many benefits: • It is very simple to implement. • It is very simple to explain to new developers. • It automatically mirrors your application’s own modular design. • It can be further refined at will. • Printing the logger automatically gives information on the locality of the log statement. However, this is not the only way for naming loggers. A common alternative is to name loggers by functional areas. For example, the “database” logger, “remoting” logger, “security” logger, or the “XML” logger. You may choose to name loggers by functionality and subcategorize by locality, as in “DATABASE.MyApp.MyClass” or “DATABASE.MyApp.MyModule.MyOtherClass”. You are totally free in choosing the names of your loggers.
Yes, there are. You can name logging loggers by locality. It turns out that instantiating a logger in each class, with the logger name equal to the fully-qualified name of the class, is a useful and straightforward approach of defining loggers. This approach has many benefits: • It is very simple to implement. • It is very simple to explain to new developers. • It automatically mirrors your application’s own modular design. • It can be further refined at will. • Printing the logger automatically gives information on the locality of the log statement. However, this is not the only way for naming loggers. A common alternative is to name loggers by functional areas. For example, the “database” logger, “remoting” logger, “security” logger, or the “XML” logger. You may choose to name loggers by functionality and subcategorize by locality, as in “DATABASE.MyApp.MyClass” or “DATABASE.MyApp.MyModule.MyOtherClass”. You are totally free in choosing the names of your loggers. The log4net package