Package org.owasp.esapi.logging.slf4j
Class Slf4JLogger
- java.lang.Object
-
- org.owasp.esapi.logging.slf4j.Slf4JLogger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.owasp.esapi.Logger
Logger.EventType
-
-
Field Summary
-
Fields inherited from interface org.owasp.esapi.Logger
ALL, DEBUG, ERROR, EVENT_FAILURE, EVENT_SUCCESS, EVENT_UNSPECIFIED, FATAL, INFO, OFF, SECURITY_AUDIT, SECURITY_FAILURE, SECURITY_SUCCESS, TRACE, WARNING
-
-
Constructor Summary
Constructors Constructor Description Slf4JLogger(org.slf4j.Logger slf4JLogger, Slf4JLogBridge bridge, int defaultEsapiLevel)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalways(Logger.EventType type, java.lang.String message)Log an event regardless of what logging level is enabled.voidalways(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log an event regardless of what logging level is enabled and also record the stack trace associated with the event.voiddebug(Logger.EventType type, java.lang.String message)Log a debug level security event if 'debug' level logging is enabled.voiddebug(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log a debug level security event if 'debug' level logging is enabled and also record the stack trace associated with the event.voiderror(Logger.EventType type, java.lang.String message)Log an error level security event if 'error' level logging is enabled.voiderror(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log an error level security event if 'error' level logging is enabled and also record the stack trace associated with the event.voidfatal(Logger.EventType type, java.lang.String message)Log a fatal event if 'fatal' level logging is enabled.voidfatal(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log a fatal level security event if 'fatal' level logging is enabled and also record the stack trace associated with the event.intgetESAPILevel()Retrieve the current ESAPI logging level for this logger.voidinfo(Logger.EventType type, java.lang.String message)Log an info level security event if 'info' level logging is enabled.voidinfo(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log an info level security event if 'info' level logging is enabled and also record the stack trace associated with the event.booleanisDebugEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.booleanisErrorEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.booleanisFatalEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.booleanisInfoEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.booleanisTraceEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.booleanisWarningEnabled()Allows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.voidsetLevel(int level)Dynamically set the ESAPI logging severity level.voidtrace(Logger.EventType type, java.lang.String message)Log a trace level security event if 'trace' level logging is enabled.voidtrace(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log a trace level security event if 'trace' level logging is enabled and also record the stack trace associated with the event.voidwarning(Logger.EventType type, java.lang.String message)Log a warning level security event if 'warning' level logging is enabled.voidwarning(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)Log a warning level security event if 'warning' level logging is enabled and also record the stack trace associated with the event.
-
-
-
Constructor Detail
-
Slf4JLogger
public Slf4JLogger(org.slf4j.Logger slf4JLogger, Slf4JLogBridge bridge, int defaultEsapiLevel)Constructs a new instance.- Parameters:
slf4JLogger- Delegate SLF4J logger.bridge- Translator for ESAPI -> SLF4J logging events.defaultEsapiLevel- Maximum ESAPI log level events to propagate.
-
-
Method Detail
-
always
public void always(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog an event regardless of what logging level is enabled.
Note that logging will not occur if the underlying logging implementation has logging disabled.
-
always
public void always(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog an event regardless of what logging level is enabled and also record the stack trace associated with the event.
Note that logging will not occur if the underlying logging implementation has logging disabled.
-
trace
public void trace(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog a trace level security event if 'trace' level logging is enabled.
-
trace
public void trace(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog a trace level security event if 'trace' level logging is enabled and also record the stack trace associated with the event.
-
debug
public void debug(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog a debug level security event if 'debug' level logging is enabled.
-
debug
public void debug(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog a debug level security event if 'debug' level logging is enabled and also record the stack trace associated with the event.
-
info
public void info(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog an info level security event if 'info' level logging is enabled.
-
info
public void info(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog an info level security event if 'info' level logging is enabled and also record the stack trace associated with the event.
-
warning
public void warning(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog a warning level security event if 'warning' level logging is enabled.
-
warning
public void warning(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog a warning level security event if 'warning' level logging is enabled and also record the stack trace associated with the event.
-
error
public void error(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog an error level security event if 'error' level logging is enabled.
-
error
public void error(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog an error level security event if 'error' level logging is enabled and also record the stack trace associated with the event.
-
fatal
public void fatal(Logger.EventType type, java.lang.String message)
Description copied from interface:LoggerLog a fatal event if 'fatal' level logging is enabled.
-
fatal
public void fatal(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:LoggerLog a fatal level security event if 'fatal' level logging is enabled and also record the stack trace associated with the event.
-
getESAPILevel
public int getESAPILevel()
Description copied from interface:LoggerRetrieve the current ESAPI logging level for this logger. SeeLog4JLoggerfor an explanation of why this method is not simply calledgetLevel().- Specified by:
getESAPILevelin interfaceLogger- Returns:
- The current logging level.
-
isTraceEnabled
public boolean isTraceEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isTraceEnabledin interfaceLogger- Returns:
- true if trace level messages will be output to the log
-
isDebugEnabled
public boolean isDebugEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isDebugEnabledin interfaceLogger- Returns:
- true if debug level messages will be output to the log
-
isInfoEnabled
public boolean isInfoEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isInfoEnabledin interfaceLogger- Returns:
- true if info level messages will be output to the log
-
isWarningEnabled
public boolean isWarningEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isWarningEnabledin interfaceLogger- Returns:
- true if warning level messages will be output to the log
-
isErrorEnabled
public boolean isErrorEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isErrorEnabledin interfaceLogger- Returns:
- true if error level messages will be output to the log
-
isFatalEnabled
public boolean isFatalEnabled()
Description copied from interface:LoggerAllows the caller to determine if messages logged at this level will be discarded, to avoid performing expensive processing.- Specified by:
isFatalEnabledin interfaceLogger- Returns:
- true if fatal level messages will be output to the log
-
setLevel
public void setLevel(int level)
Description copied from interface:LoggerDynamically set the ESAPI logging severity level. All events of this level and higher will be logged from this point forward for all logs. All events below this level will be discarded.
-
-