public class GelfLogAppender extends org.apache.log4j.AppenderSkeleton implements ErrorReporter
MDC Profiling allows to calculate the runtime from request start up to the time until the log message was generated. You must set one value in the MDC:
Two values are set by the Log Appender:
append(LoggingEvent)
method is thread-safe and may be called by different threads at any time.Modifier and Type | Field and Description |
---|---|
protected MdcGelfMessageAssembler |
gelfMessageAssembler |
protected GelfSender |
gelfSender |
Constructor and Description |
---|
GelfLogAppender() |
protected GelfSender gelfSender
protected MdcGelfMessageAssembler gelfMessageAssembler
protected void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.AppenderSkeleton
protected GelfSender createGelfSender()
public void reportError(String message, Exception exception)
ErrorReporter
reportError
in interface ErrorReporter
message
- the messageexception
- the exceptionpublic boolean requiresLayout()
requiresLayout
in interface org.apache.log4j.Appender
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
activateOptions
in class org.apache.log4j.AppenderSkeleton
public void close()
close
in interface org.apache.log4j.Appender
protected GelfMessage createGelfMessage(org.apache.log4j.spi.LoggingEvent loggingEvent)
public void setAdditionalFields(String spec)
public void setAdditionalFieldTypes(String spec)
public void setMdcFields(String spec)
public void setDynamicMdcFields(String spec)
public void setDynamicMdcFieldTypes(String spec)
public String getGraylogHost()
public void setGraylogHost(String graylogHost)
public int getGraylogPort()
public void setGraylogPort(int graylogPort)
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public String getOriginHost()
public void setOriginHost(String originHost)
public String getFacility()
public void setFacility(String facility)
public String getExtractStackTrace()
public void setExtractStackTrace(String extractStacktrace)
public boolean isFilterStackTrace()
public void setFilterStackTrace(boolean filterStackTrace)
public boolean isIncludeLocation()
public void setIncludeLocation(boolean includeLocation)
public boolean isMdcProfiling()
public void setMdcProfiling(boolean mdcProfiling)
public String getTimestampPattern()
public void setTimestampPattern(String timestampPattern)
public int getMaximumMessageSize()
public void setMaximumMessageSize(int maximumMessageSize)
public boolean isIncludeFullMdc()
public void setIncludeFullMdc(boolean includeFullMdc)
public String getVersion()
public void setVersion(String version)
Copyright © 2013–2023. All rights reserved.