Methods Summary |
---|
public void | addAppender(org.apache.log4j.Appender newAppender)Attach an appender. If the appender is already in the list in
won't be added again.
// Null values for newAppender parameter are strictly forbidden.
if(newAppender == null)
return;
if(appenderList == null) {
appenderList = new Vector(1);
}
if(!appenderList.contains(newAppender))
appenderList.addElement(newAppender);
|
public int | appendLoopOnAppenders(org.apache.log4j.spi.LoggingEvent event)Call the doAppend method on all attached appenders.
int size = 0;
Appender appender;
if(appenderList != null) {
size = appenderList.size();
for(int i = 0; i < size; i++) {
appender = (Appender) appenderList.elementAt(i);
appender.doAppend(event);
}
}
return size;
|
public java.util.Enumeration | getAllAppenders()Get all attached appenders as an Enumeration. If there are no
attached appenders null is returned.
if(appenderList == null)
return null;
else
return appenderList.elements();
|
public org.apache.log4j.Appender | getAppender(java.lang.String name)Look for an attached appender named as name .
Return the appender with that name if in the list. Return null
otherwise.
if(appenderList == null || name == null)
return null;
int size = appenderList.size();
Appender appender;
for(int i = 0; i < size; i++) {
appender = (Appender) appenderList.elementAt(i);
if(name.equals(appender.getName()))
return appender;
}
return null;
|
public boolean | isAttached(org.apache.log4j.Appender appender)Returns true if the specified appender is in the
list of attached appenders, false otherwise.
if(appenderList == null || appender == null)
return false;
int size = appenderList.size();
Appender a;
for(int i = 0; i < size; i++) {
a = (Appender) appenderList.elementAt(i);
if(a == appender)
return true;
}
return false;
|
public void | removeAllAppenders()Remove and close all previously attached appenders.
if(appenderList != null) {
int len = appenderList.size();
for(int i = 0; i < len; i++) {
Appender a = (Appender) appenderList.elementAt(i);
a.close();
}
appenderList.removeAllElements();
appenderList = null;
}
|
public void | removeAppender(org.apache.log4j.Appender appender)Remove the appender passed as parameter form the list of attached
appenders.
if(appender == null || appenderList == null)
return;
appenderList.removeElement(appender);
|
public void | removeAppender(java.lang.String name)Remove the appender with the name passed as parameter form the
list of appenders.
if(name == null || appenderList == null) return;
int size = appenderList.size();
for(int i = 0; i < size; i++) {
if(name.equals(((Appender)appenderList.elementAt(i)).getName())) {
appenderList.removeElementAt(i);
break;
}
}
|