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 Classes Modifier and Type Class Description static class
HttpAppender.Builder<B extends HttpAppender.Builder<B>>
Builds HttpAppender instances.-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.Appender
ELEMENT_TYPE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(LogEvent event)
Logs a LogEvent using whatever logic this Appender wishes to use.static <B extends HttpAppender.Builder<B>>
BnewBuilder()
void
start()
Make the Filter available for use.boolean
stop(long timeout, TimeUnit timeUnit)
Cleanup the Filter.String
toString()
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable
-
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
-
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
-
-
-
Method Detail
-
newBuilder
@PluginBuilderFactory public static <B extends HttpAppender.Builder<B>> B newBuilder()
- Returns:
- a builder for a HttpAppender.
-
start
public void start()
Description copied from class:AbstractFilterable
Make the Filter available for use.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classAbstractFilterable
-
append
public void append(LogEvent event)
Description copied from interface:Appender
Logs 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
public boolean stop(long timeout, TimeUnit timeUnit)
Description copied from class:AbstractFilterable
Cleanup the Filter.- Specified by:
stop
in interfaceLifeCycle2
- Overrides:
stop
in 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
public String toString()
- Overrides:
toString
in classAbstractAppender
-
-