Search:     Advanced search
server monitoring

Poor Logging Practice: Multiple Loggers

Article ID: 117
Last updated: 06 May, 2008
Views: 269
Posted: 06 May, 2008
by: Tech Pubs S.
Updated: 06 May, 2008
by: Tech Pubs S.

Poor Logging Practice: Multiple Loggers

Abstract

It is a poor logging practice to use multiple loggers rather than logging levels in a single class.

Description

Good logging practice dictates the use of a single logger that supports different logging levels for each class.

Examples

The following code errantly declares multiple loggers.

	public class MyClass {
private final static Logger good =
Logger.getLogger(MyClass.class);
private final static Logger bad =
Logger.getLogger(MyClass.class);
private final static Logger ugly =
Logger.getLogger(MyClass.class);
...
}

This article was:   Helpful | Not Helpful
Prev   Next
Poor Logging Practice: Use of a System Output Stream     Poor Logging Practice: Logger Not Declared Static Final