@Plugin(name="GELF",
category="Core",
elementType="appender",
printObject=true)
public class GelfAppender
extends org.apache.logging.log4j.core.appender.AbstractAppender
| Modifier | Constructor and Description |
|---|---|
protected |
GelfAppender(String name,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
org.apache.logging.log4j.core.Filter filter,
boolean ignoreExceptions,
org.graylog2.gelfclient.GelfConfiguration gelfConfiguration,
String hostName,
boolean includeSource,
boolean includeThreadContext,
boolean includeStackTrace) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(org.apache.logging.log4j.core.LogEvent event) |
static GelfAppender |
createGelfAppender(org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
String name,
Boolean ignoreExceptions,
String server,
Integer port,
String protocol,
String hostName,
Integer queueSize,
Integer connectTimeout,
Integer reconnectDelay,
Integer sendBufferSize,
Boolean tcpNoDelay,
Boolean includeSource,
Boolean includeThreadContext,
Boolean includeStackTrace)
Factory method for creating a
GelfTransport provider within the plugin manager. |
void |
start() |
void |
stop() |
String |
toString() |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandleraddFilter, getFilter, hasFilter, isFiltered, removeFiltergetState, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStoppingprotected GelfAppender(String name, org.apache.logging.log4j.core.Layout<? extends Serializable> layout, org.apache.logging.log4j.core.Filter filter, boolean ignoreExceptions, org.graylog2.gelfclient.GelfConfiguration gelfConfiguration, String hostName, boolean includeSource, boolean includeThreadContext, boolean includeStackTrace)
public void append(org.apache.logging.log4j.core.LogEvent event)
public void start()
start in interface org.apache.logging.log4j.core.LifeCyclestart in class org.apache.logging.log4j.core.filter.AbstractFilterablepublic void stop()
stop in interface org.apache.logging.log4j.core.LifeCyclestop in class org.apache.logging.log4j.core.filter.AbstractFilterablepublic String toString()
toString in class org.apache.logging.log4j.core.appender.AbstractAppender@PluginFactory public static GelfAppender createGelfAppender(@PluginElement(value="Filter") org.apache.logging.log4j.core.Filter filter, @PluginElement(value="Layout") org.apache.logging.log4j.core.Layout<? extends Serializable> layout, @PluginAttribute(value="name") String name, @PluginAttribute(value="ignoreExceptions",defaultBoolean=true) Boolean ignoreExceptions, @PluginAttribute(value="server",defaultString="localhost") String server, @PluginAttribute(value="port",defaultInt=12201) Integer port, @PluginAttribute(value="protocol",defaultString="UDP") String protocol, @PluginAttribute(value="hostName") String hostName, @PluginAttribute(value="queueSize",defaultInt=512) Integer queueSize, @PluginAttribute(value="connectTimeout",defaultInt=1000) Integer connectTimeout, @PluginAttribute(value="reconnectDelay",defaultInt=500) Integer reconnectDelay, @PluginAttribute(value="sendBufferSize",defaultInt=-1) Integer sendBufferSize, @PluginAttribute(value="tcpNoDelay",defaultBoolean=false) Boolean tcpNoDelay, @PluginAttribute(value="includeSource",defaultBoolean=true) Boolean includeSource, @PluginAttribute(value="includeThreadContext",defaultBoolean=true) Boolean includeThreadContext, @PluginAttribute(value="includeStackTrace",defaultBoolean=true) Boolean includeStackTrace)
GelfTransport provider within the plugin manager.name - The name of the Appender.filter - A Filter to determine if the event should be handled by this Appender.layout - The Layout to use to format the LogEvent defaults to "%m%n".ignoreExceptions - The default is true, causing exceptions encountered while appending events
to be internally logged and then ignored. When set to false exceptions will
be propagated to the caller, instead. Must be set to false when wrapping this
Appender in a FailoverAppender.server - The server name of the GELF server, defaults to localhost.port - The port the GELF server is listening on, defaults to 12201.hostName - The host name of the machine generating the logs, defaults to local host name
or localhost if it couldn't be detected.protocol - The transport protocol to use, defaults to UDP.queueSize - The size of the internally used queue, defaults to 512.connectTimeout - The connection timeout for TCP connections in milliseconds, defaults to 1000.reconnectDelay - The time to wait between reconnects in milliseconds, defaults to 500.sendBufferSize - The size of the socket send buffer in bytes, defaults to -1 (deactivate).tcpNoDelay - Whether Nagle's algorithm should be used for TCP connections, defaults to false.includeSource - Whether the source of the log message should be included, defaults to true.includeThreadContext - Whether the contents of the ThreadContext should be included, defaults to true.includeStackTrace - Whether a full stack trace should be included, defaults to true.Copyright © 2014 TORCH. All Rights Reserved.