class Appenders
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static org.jboss.logmanager.Logger.AttachmentKey<java.util.concurrent.CopyOnWriteArrayList<org.apache.log4j.Appender>> |
APPENDERS_KEY |
| Constructor and Description |
|---|
Appenders() |
| Modifier and Type | Method and Description |
|---|---|
static void |
attachAppender(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
Attaches an appender to the logger.
|
static void |
closeAppenders(org.jboss.logmanager.Logger logger)
Closes the appenders attached to the logger if the appenders are an instance of
AppenderAttachable. |
static org.apache.log4j.Appender |
getAppender(org.jboss.logmanager.Logger logger,
java.lang.String name)
Retrieves a single appender based on the appender name.
|
(package private) static java.util.concurrent.CopyOnWriteArrayList<org.apache.log4j.Appender> |
getAppenderList(org.jboss.logmanager.Logger logger) |
static java.util.List<org.apache.log4j.Appender> |
getAppenders(org.jboss.logmanager.Logger logger)
Retrieves all the appenders that are associated with this logger only.
|
static boolean |
isAppenderAttached(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
Checks the logger to see if the appender is attached.
|
static java.util.List<org.apache.log4j.Appender> |
removeAllAppenders(org.jboss.logmanager.Logger logger)
Removes all the appenders from the logger and returns the all the appenders that were removed.
|
static boolean |
removeAppender(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
Removes a single appender from the logger.
|
private static final org.jboss.logmanager.Logger.AttachmentKey<java.util.concurrent.CopyOnWriteArrayList<org.apache.log4j.Appender>> APPENDERS_KEY
public static void attachAppender(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
logger - the logger to attach the appender to.appender - the appender to attach.public static java.util.List<org.apache.log4j.Appender> getAppenders(org.jboss.logmanager.Logger logger)
logger - the logger to retrieve the appenders on.public static org.apache.log4j.Appender getAppender(org.jboss.logmanager.Logger logger,
java.lang.String name)
logger - the logger to check fot the appender.name - the name of the appender.null if the appender was not found.public static boolean isAppenderAttached(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
logger - the logger to check for the appender.appender - the appender to check for.true if the appender is found on the logger, otherwise false.public static java.util.List<org.apache.log4j.Appender> removeAllAppenders(org.jboss.logmanager.Logger logger)
logger - the logger to remove the appenders from.public static boolean removeAppender(org.jboss.logmanager.Logger logger,
org.apache.log4j.Appender appender)
logger - the logger to remove the appender from.appender - the appender to remove.true if the appender wasn't null and was successfully removed, otherwise false.public static void closeAppenders(org.jboss.logmanager.Logger logger)
AppenderAttachable.logger - the logger to close the appenders on.static java.util.concurrent.CopyOnWriteArrayList<org.apache.log4j.Appender> getAppenderList(org.jboss.logmanager.Logger logger)