|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.log4j.Category org.apache.log4j.Logger org.owasp.esapi.reference.Log4JLogger
public class Log4JLogger
Reference implementation of the Logger interface. This implementation extends org.apache.log4j.Logger in order to take advantage of per-class and per-package configuration options provided by Log4J.
Log4JLogFactory
,
Log4JLoggerFactory
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.owasp.esapi.Logger |
---|
Logger.EventType |
Field Summary |
---|
Fields inherited from class org.apache.log4j.Category |
---|
additive, level, name, parent, repository, resourceBundle |
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 | |
---|---|
Log4JLogger(java.lang.String name)
|
Method Summary | |
---|---|
void |
always(Logger.EventType type,
java.lang.String message)
Log an event regardless of what logging level is enabled. |
void |
always(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. |
void |
always(java.lang.Object message)
Always log the specified message as a SECURITY_AUDIT event type. |
void |
always(java.lang.Object message,
java.lang.Throwable throwable)
Always log the specified message as a SECURITY_AUDIT event type, along
with its associated exception stack trace (if any). |
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 |
debug(java.lang.Object message)
|
void |
debug(java.lang.Object message,
java.lang.Throwable throwable)
|
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 |
error(java.lang.Object message)
|
void |
error(java.lang.Object message,
java.lang.Throwable throwable)
|
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 |
fatal(java.lang.Object message)
|
void |
fatal(java.lang.Object message,
java.lang.Throwable throwable)
|
int |
getESAPILevel()
Retrieve the current ESAPI logging level for this logger. |
static org.apache.log4j.Category |
getInstance(java.lang.Class clazz)
This method overrides Category.getInstance(java.lang.String) by supplying
its own factory type as a parameter. |
static org.apache.log4j.Category |
getInstance(java.lang.String name)
This method overrides Category.getInstance(java.lang.String) by supplying
its own factory type as a parameter. |
static org.apache.log4j.Logger |
getLogger(java.lang.Class clazz)
This method overrides Logger.getLogger(java.lang.String) by supplying
its own factory type as a parameter. |
static org.apache.log4j.Logger |
getLogger(java.lang.String name)
This method overrides Logger.getLogger(java.lang.String) by supplying
its own factory type as a parameter. |
java.lang.String |
getUserInfo()
|
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. |
void |
info(java.lang.Object message)
|
void |
info(java.lang.Object message,
java.lang.Throwable throwable)
|
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 ESAPI 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 |
trace(java.lang.Object message)
|
void |
trace(java.lang.Object message,
java.lang.Throwable throwable)
|
void |
warn(java.lang.Object message)
|
void |
warn(java.lang.Object message,
java.lang.Throwable throwable)
|
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. |
Methods inherited from class org.apache.log4j.Logger |
---|
getLogger, getRootLogger |
Methods inherited from class org.apache.log4j.Category |
---|
addAppender, assertLog, callAppenders, exists, forcedLog, getAdditivity, getAllAppenders, getAppender, getChainedPriority, getCurrentCategories, getDefaultHierarchy, getEffectiveLevel, getHierarchy, getLevel, getLoggerRepository, getName, getParent, getPriority, getResourceBundle, getResourceBundleString, getRoot, isAttached, isEnabledFor, l7dlog, l7dlog, log, log, log, removeAllAppenders, removeAppender, removeAppender, setAdditivity, setLevel, setPriority, setResourceBundle, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Log4JLogger(java.lang.String name)
Method Detail |
---|
public static org.apache.log4j.Category getInstance(java.lang.String name)
Category.getInstance(java.lang.String)
by supplying
its own factory type as a parameter.
public static org.apache.log4j.Category getInstance(java.lang.Class clazz)
Category.getInstance(java.lang.String)
by supplying
its own factory type as a parameter.
public static org.apache.log4j.Logger getLogger(java.lang.String name)
Logger.getLogger(java.lang.String)
by supplying
its own factory type as a parameter.
public static org.apache.log4j.Logger getLogger(java.lang.Class clazz)
Logger.getLogger(java.lang.String)
by supplying
its own factory type as a parameter.
public void setLevel(int level)
setLevel
in interface Logger
level
- The level to set the logging level to.public int getESAPILevel()
Log4JLogger
for an explanation of
why this method is not simply called getLevel()
.
Explanation: Since this class extends Log4j's Logger class which has a
getLevel()
method that returns extended by org.apache.log4j.Level
,
we can't simply have a getLevel()
that simply returns an int
.
Hence we renamed it to getESAPILevel()
.
getESAPILevel
in interface Logger
public void always(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
always
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void always(Logger.EventType type, java.lang.String message)
always
in interface Logger
type
- the type of eventmessage
- the message to logpublic void trace(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
trace
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void trace(Logger.EventType type, java.lang.String message)
trace
in interface Logger
type
- the type of eventmessage
- the message to logpublic void debug(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
debug
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void debug(Logger.EventType type, java.lang.String message)
debug
in interface Logger
type
- the type of eventmessage
- the message to logpublic void info(Logger.EventType type, java.lang.String message)
info
in interface Logger
type
- the type of eventmessage
- the message to logpublic void info(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
info
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void warning(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
warning
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void warning(Logger.EventType type, java.lang.String message)
warning
in interface Logger
type
- the type of eventmessage
- the message to logpublic void error(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
error
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void error(Logger.EventType type, java.lang.String message)
error
in interface Logger
type
- the type of eventmessage
- the message to logpublic void fatal(Logger.EventType type, java.lang.String message, java.lang.Throwable throwable)
fatal
in interface Logger
type
- the type of eventmessage
- the message to logthrowable
- the exception to be loggedpublic void fatal(Logger.EventType type, java.lang.String message)
fatal
in interface Logger
type
- the type of eventmessage
- the message to logpublic void always(java.lang.Object message)
SECURITY_AUDIT
event type.
message
- The String
representation of the specified message as
logged by calling the object's toString()
method.public void always(java.lang.Object message, java.lang.Throwable throwable)
SECURITY_AUDIT
event type, along
with its associated exception stack trace (if any).
message
- The String
representation of the specified message as
logged by calling the object's toString()
method.public void trace(java.lang.Object message)
trace
in class org.apache.log4j.Logger
public void trace(java.lang.Object message, java.lang.Throwable throwable)
trace
in class org.apache.log4j.Logger
public void debug(java.lang.Object message)
debug
in class org.apache.log4j.Category
public void debug(java.lang.Object message, java.lang.Throwable throwable)
debug
in class org.apache.log4j.Category
public void info(java.lang.Object message)
info
in class org.apache.log4j.Category
public void info(java.lang.Object message, java.lang.Throwable throwable)
info
in class org.apache.log4j.Category
public void warn(java.lang.Object message)
warn
in class org.apache.log4j.Category
public void warn(java.lang.Object message, java.lang.Throwable throwable)
warn
in class org.apache.log4j.Category
public void error(java.lang.Object message)
error
in class org.apache.log4j.Category
public void error(java.lang.Object message, java.lang.Throwable throwable)
error
in class org.apache.log4j.Category
public void fatal(java.lang.Object message)
fatal
in class org.apache.log4j.Category
public void fatal(java.lang.Object message, java.lang.Throwable throwable)
fatal
in class org.apache.log4j.Category
public boolean isDebugEnabled()
isDebugEnabled
in interface Logger
isDebugEnabled
in class org.apache.log4j.Category
public boolean isErrorEnabled()
isErrorEnabled
in interface Logger
public boolean isFatalEnabled()
isFatalEnabled
in interface Logger
public boolean isInfoEnabled()
isInfoEnabled
in interface Logger
isInfoEnabled
in class org.apache.log4j.Category
public boolean isTraceEnabled()
isTraceEnabled
in interface Logger
isTraceEnabled
in class org.apache.log4j.Logger
public boolean isWarningEnabled()
isWarningEnabled
in interface Logger
public java.lang.String getUserInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |