public class GelfLogbackAppender extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent> 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(ILoggingEvent)
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 |
---|
GelfLogbackAppender() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(ch.qos.logback.classic.spi.ILoggingEvent event) |
protected GelfMessage |
createGelfMessage(ch.qos.logback.classic.spi.ILoggingEvent loggingEvent) |
protected GelfSender |
createGelfSender() |
String |
getExtractStackTrace() |
String |
getFacility() |
String |
getGraylogHost() |
int |
getGraylogPort() |
String |
getHost() |
int |
getMaximumMessageSize() |
String |
getOriginHost() |
int |
getPort() |
String |
getTimestampPattern() |
String |
getVersion() |
boolean |
isFilterStackTrace() |
boolean |
isIncludeFullMdc() |
boolean |
isIncludeLocation() |
boolean |
isMdcProfiling() |
void |
reportError(String message,
Exception exception)
Report an error caused by a exception.
|
void |
setAdditionalFields(String spec) |
void |
setAdditionalFieldTypes(String spec) |
void |
setDynamicMdcFields(String spec) |
void |
setDynamicMdcFieldTypes(String spec) |
void |
setExtractStackTrace(String extractStacktrace) |
void |
setFacility(String facility) |
void |
setFilterStackTrace(boolean filterStackTrace) |
void |
setGraylogHost(String graylogHost) |
void |
setGraylogPort(int graylogPort) |
void |
setHost(String host) |
void |
setIncludeFullMdc(boolean includeFullMdc) |
void |
setIncludeLocation(boolean includeLocation) |
void |
setMaximumMessageSize(int maximumMessageSize) |
void |
setMdcFields(String spec) |
void |
setMdcProfiling(boolean mdcProfiling) |
void |
setOriginHost(String originHost) |
void |
setPort(int port) |
void |
setTimestampPattern(String timestampPattern) |
void |
setVersion(String version) |
void |
start() |
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
protected GelfSender gelfSender
protected MdcGelfMessageAssembler gelfMessageAssembler
protected void append(ch.qos.logback.classic.spi.ILoggingEvent event)
append
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
public void start()
start
in interface ch.qos.logback.core.spi.LifeCycle
start
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
public void stop()
stop
in interface ch.qos.logback.core.spi.LifeCycle
stop
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
protected GelfSender createGelfSender()
public void reportError(String message, Exception exception)
ErrorReporter
reportError
in interface ErrorReporter
message
- the messageexception
- the exceptionprotected GelfMessage createGelfMessage(ch.qos.logback.classic.spi.ILoggingEvent 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 String getOriginHost()
public void setOriginHost(String originHost)
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 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.