public final class NOPLogger extends Logger
Constructor and Description |
---|
NOPLogger(NOPLoggerRepository repo,
String name)
Create instance of Logger.
|
Modifier and Type | Method and Description |
---|---|
void |
addAppender(Appender newAppender)
Add
newAppender to the list of appenders of this Category instance. |
void |
assertLog(boolean assertion,
String msg)
|
void |
callAppenders(LoggingEvent event)
Call the appenders in the hierrachy starting at
this . |
void |
debug(Object message) |
void |
debug(Object message,
Throwable t) |
void |
error(Object message) |
void |
error(Object message,
Throwable t) |
void |
fatal(Object message) |
void |
fatal(Object message,
Throwable t) |
Enumeration |
getAllAppenders()
Get the appenders contained in this category as an
Enumeration . |
Appender |
getAppender(String name)
Look for the appender named as
name . |
Priority |
getChainedPriority() |
Level |
getEffectiveLevel() |
ResourceBundle |
getResourceBundle() |
void |
info(Object message) |
void |
info(Object message,
Throwable t) |
boolean |
isAttached(Appender appender)
Is the appender passed as parameter attached to this category?
|
boolean |
isDebugEnabled() |
boolean |
isEnabledFor(Priority level) |
boolean |
isInfoEnabled() |
boolean |
isTraceEnabled() |
void |
l7dlog(Priority priority,
String key,
Object[] params,
Throwable t) |
void |
l7dlog(Priority priority,
String key,
Throwable t) |
void |
log(Priority priority,
Object message) |
void |
log(Priority priority,
Object message,
Throwable t) |
void |
log(String callerFQCN,
Priority level,
Object message,
Throwable t) |
void |
removeAllAppenders()
Removes all previously added appenders from this Category instance.
|
void |
removeAppender(Appender appender)
Removes the appender passed as parameter form the list of appenders.
|
void |
removeAppender(String name)
Removes the appender with the name passed as parameter form the list of appenders.
|
void |
setLevel(Level level) |
void |
setPriority(Priority priority) |
void |
setResourceBundle(ResourceBundle bundle) |
void |
trace(Object message) |
void |
trace(Object message,
Throwable t) |
void |
warn(Object message) |
void |
warn(Object message,
Throwable t) |
getLogger, getLogger, getLogger, getRootLogger
exists, forcedLog, getAdditivity, getCurrentCategories, getDefaultHierarchy, getHierarchy, getInstance, getInstance, getLevel, getLoggerRepository, getName, getParent, getPriority, getRoot, isErrorEnabled, isFatalEnabled, isWarnEnabled, setAdditivity, shutdown
public NOPLogger(NOPLoggerRepository repo, String name)
repo
- repository, may not be null.name
- name, may not be null, use "root" for root logger.public void addAppender(Appender newAppender)
newAppender
to the list of appenders of this Category instance.
If newAppender
is already in the list of appenders, then it won't be added again.
addAppender
in interface AppenderAttachable
addAppender
in class Category
newAppender
- The Appender to add.public void assertLog(boolean assertion, String msg)
assertion
parameter is false
, then logs msg
as an error
statement.
The assert
method has been renamed to assertLog
because assert
is a language
reserved word in JDK 1.4.
public void callAppenders(LoggingEvent event)
this
. If no appenders could be found, emit a warning.
This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request.
callAppenders
in class Category
event
- the event to log.public Enumeration getAllAppenders()
Enumeration
. If no appenders can be found, then a
NullEnumeration
is returned.getAllAppenders
in interface AppenderAttachable
getAllAppenders
in class Category
public Appender getAppender(String name)
name
.
Return the appender with that name if in the list. Return null
otherwise.
getAppender
in interface AppenderAttachable
getAppender
in class Category
name
- The name of the Appender.public Priority getChainedPriority()
getChainedPriority
in class Category
public Level getEffectiveLevel()
getEffectiveLevel
in class Category
public ResourceBundle getResourceBundle()
getResourceBundle
in class Category
public boolean isAttached(Appender appender)
isAttached
in interface AppenderAttachable
isAttached
in class Category
appender
- The Appender to add.public boolean isDebugEnabled()
isDebugEnabled
in class Category
public boolean isEnabledFor(Priority level)
isEnabledFor
in class Category
public boolean isInfoEnabled()
isInfoEnabled
in class Category
public boolean isTraceEnabled()
isTraceEnabled
in class Logger
public void removeAllAppenders()
This is useful when re-reading configuration information.
removeAllAppenders
in interface AppenderAttachable
removeAllAppenders
in class Category
public void removeAppender(Appender appender)
removeAppender
in interface AppenderAttachable
removeAppender
in class Category
appender
- The Appender to remove.public void removeAppender(String name)
removeAppender
in interface AppenderAttachable
removeAppender
in class Category
name
- The Appender to remove.public void setPriority(Priority priority)
setPriority
in class Category
public void setResourceBundle(ResourceBundle bundle)
setResourceBundle
in class Category
Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.