|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Logger
The Logger interface defines a set of methods that can be used to log security events. It supports a hierarchy of logging levels which can be configured at runtime to determine the severity of events that are logged, and those below the current threshold that are discarded. Implementors should use a well established logging library as it is quite difficult to create a high-performance logger.
The logging levels defined by this interface (in descending order) are:
Nested Class Summary | |
---|---|
static class |
Logger.EventType
Defines the type of log event that is being generated. |
Field Summary | |
---|---|
static int |
ALL
ALL indicates that all messages should be logged. |
static int |
DEBUG
DEBUG indicates that DEBUG messages and above should be logged. |
static int |
ERROR
ERROR indicates that ERROR messages and above should be logged. |
static Logger.EventType |
EVENT_FAILURE
A non-security type of log event that has failed. |
static Logger.EventType |
EVENT_SUCCESS
A non-security type of log event that has succeeded. |
static int |
FATAL
FATAL indicates that only FATAL messages should be logged. |
static int |
INFO
INFO indicates that INFO messages and above should be logged. |
static int |
OFF
OFF indicates that no messages should be logged. |
static Logger.EventType |
SECURITY_FAILURE
A security type of log event that has failed. |
static Logger.EventType |
SECURITY_SUCCESS
A security type of log event that has succeeded. |
static int |
TRACE
TRACE indicates that TRACE messages and above should be logged. |
static int |
WARNING
WARNING indicates that WARNING messages and above should be logged. |
Method Summary | |
---|---|
void |
debug(Logger.EventType type,
java.lang.String message)
Log a debug level security event if 'debug' level logging is enabled. |
void |
debug(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. |
void |
error(Logger.EventType type,
java.lang.String message)
Log an error level security event if 'error' level logging is enabled. |
void |
error(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. |
void |
fatal(Logger.EventType type,
java.lang.String message)
Log a fatal event if 'fatal' level logging is enabled. |
void |
fatal(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. |
void |
info(Logger.EventType type,
java.lang.String message)
Log an info level security event if 'info' level logging is enabled. |
void |
info(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. |
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 |
setLevel(int level)
Dynamically set the logging severity level. |
void |
trace(Logger.EventType type,
java.lang.String message)
Log a trace level security event if 'trace' level logging is enabled. |
void |
trace(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. |
void |
warning(Logger.EventType type,
java.lang.String message)
Log a warning level security event if 'warning' level logging is enabled. |
void |
warning(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. |
Field Detail |
---|
static final Logger.EventType SECURITY_SUCCESS
static final Logger.EventType SECURITY_FAILURE
static final Logger.EventType EVENT_SUCCESS
static final Logger.EventType EVENT_FAILURE
static final int OFF
static final int FATAL
static final int ERROR
static final int WARNING
static final int INFO
static final int DEBUG
static final int TRACE
static final int ALL
Method Detail |
---|
void setLevel(int level)
level
- The level to set the logging level to.void fatal(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid fatal(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isFatalEnabled()
void error(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid error(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isErrorEnabled()
void warning(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid warning(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isWarningEnabled()
void info(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid info(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isInfoEnabled()
void debug(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid debug(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isDebugEnabled()
void trace(Logger.EventType type, java.lang.String message)
type
- the type of eventmessage
- the message to logvoid trace(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedboolean isTraceEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |