org.owasp.esapi.reference
Class Log4JLogFactory
java.lang.Object
org.owasp.esapi.reference.Log4JLogFactory
- All Implemented Interfaces:
- LogFactory
- Direct Known Subclasses:
- ExampleExtendedLog4JLogFactory
public class Log4JLogFactory
- extends java.lang.Object
- implements LogFactory
Reference implementation of the LogFactory and Logger interfaces. This implementation uses the Apache Log4J package, and marks each
log message with the currently logged in user and the word "SECURITY" for security related events. See the
JavaLogFactory.JavaLogger Javadocs for the details on the JavaLogger reference implementation.
At class initialization time, the file log4j.properties or log4j.xml file will be loaded from the classpath. This configuration file is
fundamental to make log4j work for you. Please see http://logging.apache.org/log4j/1.2/manual.html for more information.
- Since:
- June 1, 2007
- Author:
- Mike H. Fauzy ([email protected]) Aspect Security, Jim Manico ([email protected]) Manico.net, Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
- See Also:
LogFactory
,
Log4JLogFactory.Log4JLogger
Field Summary |
protected java.util.HashMap |
loggersMap
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
loggersMap
protected java.util.HashMap loggersMap
Log4JLogFactory
protected Log4JLogFactory()
getInstance
public static LogFactory getInstance()
getLogger
public Logger getLogger(java.lang.Class clazz)
- Gets the logger associated with the specified class. The class is used by the logger to log which
class is generating the log events. The implementation of this method should return any preexisting Logger
associated with this class name, rather than creating a new Logger.
The JavaLogFactory reference implementation meets these requirements.
- Specified by:
getLogger
in interface LogFactory
- Parameters:
clazz
- The name of the class requesting the logger.
- Returns:
- The Logger associated with this class.
getLogger
public Logger getLogger(java.lang.String moduleName)
- Gets the logger associated with the specified module name. The module name is used by the logger to log which
module is generating the log events. The implementation of this method should return any preexisting Logger
associated with this module name, rather than creating a new Logger.
The JavaLogFactory reference implementation meets these requirements.
- Specified by:
getLogger
in interface LogFactory
- Parameters:
moduleName
- The name of the module requesting the logger.
- Returns:
- The Logger associated with this module.
Copyright © 2010 The Open Web Application Security Project (OWASP). All Rights Reserved.