|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender<T>
public abstract class AbstractAppender<T extends Serializable>
Abstract base class for Appenders. Although Appenders do not have to extend this class, doing so will simplify their implementation.
| Field Summary | |
|---|---|
protected static Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance. |
| Constructor Summary | |
|---|---|
protected |
AbstractAppender(String name,
Filter filter,
Layout<T> layout)
Constructor that defaults to suppressing exceptions. |
protected |
AbstractAppender(String name,
Filter filter,
Layout<T> layout,
boolean handleException)
Constructor. |
| Method Summary | |
|---|---|
void |
close()
Close the stream associated with the Appender. |
void |
error(String msg)
Handle an error with a message. |
void |
error(String msg,
LogEvent event,
Throwable t)
Handle an error with a message, and exception and a logging event. |
void |
error(String msg,
Throwable t)
Handle an error with a message and an exception. |
ErrorHandler |
getHandler()
Returns the ErrorHandler, if any. |
Layout<T> |
getLayout()
Returns the Layout for the appender. |
String |
getName()
Returns the name of the Appender. |
boolean |
isExceptionSuppressed()
Some appenders need to propogate exceptions back to the application. |
boolean |
isStarted()
Returns true if the Appender is started, false otherwise. |
void |
setHandler(ErrorHandler handler)
The handler must be set before the appender is started. |
void |
start()
Start the Appender. |
void |
stop()
Stop the Appender. |
String |
toString()
|
| Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable |
|---|
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.logging.log4j.core.Appender |
|---|
append |
| Field Detail |
|---|
protected static final Logger LOGGER
| Constructor Detail |
|---|
protected AbstractAppender(String name,
Filter filter,
Layout<T> layout)
name - The Appender name.filter - The Filter to associate with the Appender.layout - The layout to use to format the event.
protected AbstractAppender(String name,
Filter filter,
Layout<T> layout,
boolean handleException)
name - The Appender name.filter - The Filter to associate with the Appender.layout - The layout to use to format the event.handleException - If true, exceptions will be logged and suppressed. If false errors will be
logged and then passed to the application.| Method Detail |
|---|
public ErrorHandler getHandler()
getHandler in interface Appender<T extends Serializable>public void setHandler(ErrorHandler handler)
setHandler in interface Appender<T extends Serializable>handler - The ErrorHandler to use.public void close()
public String getName()
getName in interface Appender<T extends Serializable>public Layout<T> getLayout()
getLayout in interface Appender<T extends Serializable>public boolean isExceptionSuppressed()
isExceptionSuppressed in interface Appender<T extends Serializable>public void start()
start in interface LifeCyclepublic void stop()
stop in interface LifeCyclepublic boolean isStarted()
isStarted in interface LifeCyclepublic String toString()
toString in class Objectpublic void error(String msg)
msg - The message.
public void error(String msg,
Throwable t)
msg - The message.t - The Throwable.
public void error(String msg,
LogEvent event,
Throwable t)
msg - The message.event - The LogEvent.t - The Throwable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||