spiffy.log4j
Class LoggerHelper
java.lang.Object
spiffy.log4j.LoggerHelper
public class LoggerHelper
- extends Object
Helper class for common Log4J interactions
- Author:
- Kasper B. Graversen, (c) 2007-2008
Method Summary |
static org.apache.log4j.Logger |
getLogger()
Returns a Log4J logger configured as the calling class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggerHelper
public LoggerHelper()
getLogger
public static org.apache.log4j.Logger getLogger()
- Returns a Log4J logger configured as the calling class. This ensures copy-paste safe code to get a logger instance,
an ensures the logger is always fetched in a consistent manner.
usage:
private final static Logger log = LoggerHelper.getLogger();
Since the logger is found by accessing the call stack it is important, that references are static.
The code is JDK1.4 compatible
- Returns:
- log4j logger instance for the calling class