Class HttpAppender
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender
org.apache.logging.log4j.core.appender.HttpAppender
- All Implemented Interfaces:
Appender, Filterable, LocationAware, LifeCycle, LifeCycle2
@Plugin(name="Http",
category="Core",
elementType="appender",
printObject=true)
public final class HttpAppender
extends AbstractAppender
Sends log events over HTTP.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHttpAppender.Builder<B extends HttpAppender.Builder<B>>Builds HttpAppender instances.Nested classes/interfaces inherited from interface LifeCycle
LifeCycle.State -
Field Summary
FieldsFields inherited from class AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERFields inherited from interface Appender
ELEMENT_TYPE, EMPTY_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateHttpAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, HttpManager manager, Property[] properties) -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a LogEvent using whatever logic this Appender wishes to use.static <B extends HttpAppender.Builder<B>>
Bvoidstart()Make the Filter available for use.booleanCleanup the Filter.toString()Methods inherited from class AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializableMethods inherited from class AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stopMethods inherited from class AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
Field Details
-
manager
-
-
Constructor Details
-
HttpAppender
private HttpAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, HttpManager manager, Property[] properties)
-
-
Method Details
-
newBuilder
- Returns:
- a builder for a HttpAppender.
-
start
public void start()Description copied from class:AbstractFilterableMake the Filter available for use.- Specified by:
startin interfaceLifeCycle- Overrides:
startin classAbstractFilterable
-
append
Description copied from interface:AppenderLogs a LogEvent using whatever logic this Appender wishes to use. It is typically recommended to use a bridge pattern not only for the benefits from decoupling an Appender from its implementation, but it is also handy for sharing resources which may require some form of locking.- Parameters:
event- The LogEvent.
-
stop
Description copied from class:AbstractFilterableCleanup the Filter.- Specified by:
stopin interfaceLifeCycle2- Overrides:
stopin classAbstractFilterable- Parameters:
timeout- the maximum time to waittimeUnit- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-
toString
- Overrides:
toStringin classAbstractAppender
-