Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.log.Logger
public class Logger
extends java.lang.Object
Field Summary | |
static char |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
Logger |
|
Logger[] |
|
LogTarget[] |
|
Priority |
|
void |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public static final char CATEGORY_SEPARATOR
Separator character use to separate different categories
- Field Value:
- '.'
public final void debug(String message)
Log a debug priority event.
- Parameters:
message
- the message
public final void debug(String message, Throwable throwable)
Log a debug priority event.
- Parameters:
message
- the messagethrowable
- the throwable
public final void error(String message)
Log a error priority event.
- Parameters:
message
- the message
public final void error(String message, Throwable throwable)
Log a error priority event.
- Parameters:
message
- the messagethrowable
- the throwable
public final void fatalError(String message)
Log a fatalError priority event.
- Parameters:
message
- the message
public final void fatalError(String message, Throwable throwable)
Log a fatalError priority event.
- Parameters:
message
- the messagethrowable
- the throwable
public final String getCategory()
Deprecated. This method violates Inversion of Control principle. If you are relying on its presence then there may be something wrong with the design of your system
Retrieve category associated with logger.
- Returns:
- the Category
public Logger getChildLogger(String subCategory) throws IllegalArgumentException
Create a new child logger. The category of child logger is [current-category].subcategory
- Parameters:
subCategory
- the subcategory of this logger
- Returns:
- the new logger
public Logger[] getChildren()
Get all the child Loggers of current logger.
- Returns:
- the child loggers
public LogTarget[] getLogTargets()
Deprecated. This method is deprecated and will be removed in Future version. Previously it allowed unsafe access to logtargets which permitted masqurade attacks. It currently returns a zero sized array.
Get a copy of log targets for this logger.
- Returns:
- the child loggers
public final Priority getPriority()
Deprecated. This method violates Inversion of Control principle. It will downgraded to protected access in a future release. When user needs to check priority it is advised that they use the is[Priority]Enabled() functions.
Retrieve priority associated with Logger.
- Returns:
- the loggers priority
public final void info(String message)
Log a info priority event.
- Parameters:
message
- the message
public final void info(String message, Throwable throwable)
Log a info priority event.
- Parameters:
message
- the messagethrowable
- the throwable
public final boolean isDebugEnabled()
Determine if messages of priority DEBUG will be logged.
- Returns:
- true if DEBUG messages will be logged
public final boolean isErrorEnabled()
Determine if messages of priority ERROR will be logged.
- Returns:
- true if ERROR messages will be logged
public final boolean isFatalErrorEnabled()
Determine if messages of priority FATAL_ERROR will be logged.
- Returns:
- true if FATAL_ERROR messages will be logged
public final boolean isInfoEnabled()
Determine if messages of priority INFO will be logged.
- Returns:
- true if INFO messages will be logged
public final boolean isPriorityEnabled(Priority priority)
Determine if messages of priority ?will be logged.
- Parameters:
priority
- the priority
- Returns:
- true if messages will be logged
public final boolean isWarnEnabled()
Determine if messages of priority WARN will be logged.
- Returns:
- true if WARN messages will be logged
public final void log(Priority priority, String message)
Log a event at specific priority with a certain message.
- Parameters:
priority
- the prioritymessage
- the message
public final void log(Priority priority, String message, Throwable throwable)
Log a event at specific priority with a certain message and throwable.
- Parameters:
priority
- the prioritymessage
- the messagethrowable
- the throwable
public final void setAdditivity(boolean additivity)
Make this logger additive. I.e. Send all log events to parent loggers LogTargets regardless of whether or not the LogTargets have been overidden. This is derived from Log4js notion of Additivity.
- Parameters:
additivity
- true to make logger additive, false otherwise
public void setLogTargets(LogTarget[] logTargets)
Set the log targets for this logger.
- Parameters:
logTargets
- the Log Targets
public void setPriority(Priority priority)
Set the priority for this logger.
- Parameters:
priority
- the priority
public void unsetLogTargets()
Unset the logtargets for this logger. This logger (and thus all child loggers who don't specify logtargets) will inherit from the parents LogTargets.
public void unsetLogTargets(boolean recursive)
Unset the logtargets for this logger and all child loggers if recursive is set. The loggers unset (and all child loggers who don't specify logtargets) will inherit from the parents LogTargets.
- Parameters:
recursive
- the recursion policy
public void unsetPriority()
Unset the priority of Logger. (Thus it will use it's parent's priority or DEBUG if no parent.
public void unsetPriority(boolean recursive)
Unset the priority of Logger. (Thus it will use it's parent's priority or DEBUG if no parent. If recursive is true unset priorities of all child loggers.
- Parameters:
recursive
- true to unset priority of all child loggers
public final void warn(String message)
Log a warn priority event.
- Parameters:
message
- the message
public final void warn(String message, Throwable throwable)
Log a warn priority event.
- Parameters:
message
- the messagethrowable
- the throwable