org.owasp.esapi
Class Logger

java.lang.Object
  extended byorg.owasp.esapi.Logger
All Implemented Interfaces:
ILogger

public class Logger
extends java.lang.Object
implements ILogger

Reference implementation of the ILogger interface. 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.

Since:
June 1, 2007
Author:
Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
See Also:
ILogger

Field Summary
 
Fields inherited from interface org.owasp.esapi.interfaces.ILogger
PERFORMANCE, SECURITY, USABILITY
 
Constructor Summary
Logger(java.lang.String applicationName, java.lang.String moduleName)
          Public constructor should only ever be called via the appropriate LogFactory
 
Method Summary
 void debug(java.lang.String type, java.lang.String message)
          Log debug.
 void debug(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log debug.
 void error(java.lang.String type, java.lang.String message)
          Log error.
 void error(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log error.
 void fatal(java.lang.String type, java.lang.String message)
          Log critical.
 void fatal(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log critical.
 void info(java.lang.String type, java.lang.String message)
          Log success.
 void info(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log success.
 boolean isDebugEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 boolean isErrorEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 boolean isFatalEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 boolean isInfoEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 boolean isTraceEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 boolean isWarningEnabled()
          Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing
 void logSpecial(java.lang.String message, java.lang.Throwable throwable)
          This special method doesn't include the current user's identity, and is only used during system initialization to prevent loops with the Authenticator.
 void trace(java.lang.String type, java.lang.String message)
          Log trace.
 void trace(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log trace.
 void warning(java.lang.String type, java.lang.String message)
          Log warning.
 void warning(java.lang.String type, java.lang.String message, java.lang.Throwable throwable)
          Log warning.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger(java.lang.String applicationName,
              java.lang.String moduleName)
Public constructor should only ever be called via the appropriate LogFactory

Parameters:
applicationName - the application name
moduleName - the module name
Method Detail

trace

public void trace(java.lang.String type,
                  java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: ILogger
Log trace.

Specified by:
trace in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

trace

public void trace(java.lang.String type,
                  java.lang.String message)
Description copied from interface: ILogger
Log trace.

Specified by:
trace in interface ILogger
Parameters:
type - the type
message - the message

debug

public void debug(java.lang.String type,
                  java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: ILogger
Log debug.

Specified by:
debug in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

debug

public void debug(java.lang.String type,
                  java.lang.String message)
Description copied from interface: ILogger
Log debug.

Specified by:
debug in interface ILogger
Parameters:
type - the type
message - the message

error

public void error(java.lang.String type,
                  java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: ILogger
Log error.

Specified by:
error in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

error

public void error(java.lang.String type,
                  java.lang.String message)
Description copied from interface: ILogger
Log error.

Specified by:
error in interface ILogger
Parameters:
type - the type
message - the message

info

public void info(java.lang.String type,
                 java.lang.String message)
Description copied from interface: ILogger
Log success.

Specified by:
info in interface ILogger
Parameters:
type - the type
message - the message

info

public void info(java.lang.String type,
                 java.lang.String message,
                 java.lang.Throwable throwable)
Description copied from interface: ILogger
Log success.

Specified by:
info in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

warning

public void warning(java.lang.String type,
                    java.lang.String message,
                    java.lang.Throwable throwable)
Description copied from interface: ILogger
Log warning.

Specified by:
warning in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

warning

public void warning(java.lang.String type,
                    java.lang.String message)
Description copied from interface: ILogger
Log warning.

Specified by:
warning in interface ILogger
Parameters:
type - the type
message - the message

fatal

public void fatal(java.lang.String type,
                  java.lang.String message,
                  java.lang.Throwable throwable)
Description copied from interface: ILogger
Log critical.

Specified by:
fatal in interface ILogger
Parameters:
type - the type
message - the message
throwable - the throwable

fatal

public void fatal(java.lang.String type,
                  java.lang.String message)
Description copied from interface: ILogger
Log critical.

Specified by:
fatal in interface ILogger
Parameters:
type - the type
message - the message

logSpecial

public void logSpecial(java.lang.String message,
                       java.lang.Throwable throwable)
This special method doesn't include the current user's identity, and is only used during system initialization to prevent loops with the Authenticator.

Parameters:
message -
throwable -

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isDebugEnabled in interface ILogger
Returns:
true if messages will be output to the log

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isErrorEnabled in interface ILogger
Returns:
true if messages will be output to the log

isFatalEnabled

public boolean isFatalEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isFatalEnabled in interface ILogger
Returns:
true if messages will be output to the log

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isInfoEnabled in interface ILogger
Returns:
true if messages will be output to the log

isTraceEnabled

public boolean isTraceEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isTraceEnabled in interface ILogger
Returns:
true if messages will be output to the log

isWarningEnabled

public boolean isWarningEnabled()
Description copied from interface: ILogger
Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing

Specified by:
isWarningEnabled in interface ILogger
Returns:
true if messages will be output to the log