org.owasp.esapi.reference
Class JavaLogFactory

java.lang.Object
  extended by org.owasp.esapi.reference.JavaLogFactory
All Implemented Interfaces:
LogFactory

public class JavaLogFactory
extends Object
implements LogFactory

Reference implementation of the LogFactory and Logger interfaces. This implementation uses the Java logging 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.

Since:
June 1, 2007
Author:
Mike Fauzy ([email protected]) Aspect Security, Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
See Also:
LogFactory, JavaLogFactory.JavaLogger

Nested Class Summary
static class JavaLogFactory.JavaLoggerLevel
          A custom logging level defined between Level.SEVERE and Level.WARNING in logger.
 
Constructor Summary
JavaLogFactory()
          Null argument constructor for this implementation of the LogFactory interface needed for dynamic configuration.
 
Method Summary
static LogFactory getInstance()
           
 Logger getLogger(Class clazz)
          Gets the logger associated with the specified class.
 Logger getLogger(String moduleName)
          Gets the logger associated with the specified module name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaLogFactory

public JavaLogFactory()
Null argument constructor for this implementation of the LogFactory interface needed for dynamic configuration.

Method Detail

getInstance

public static LogFactory getInstance()

getLogger

public Logger getLogger(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(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 © 2011 The Open Web Application Security Project (OWASP). All Rights Reserved.