public class GelfLogHandler extends Handler implements ErrorReporter
LogRecord.getParameters()
, default truepublish(LogRecord)
method is thread-safe and may be called by different threads at any time.Modifier and Type | Field and Description |
---|---|
protected GelfMessageAssembler |
gelfMessageAssembler |
protected GelfSender |
gelfSender |
Constructor and Description |
---|
GelfLogHandler() |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
protected volatile GelfSender gelfSender
protected GelfMessageAssembler gelfMessageAssembler
protected void initializeDefaultFields()
protected GelfMessageAssembler createGelfMessageAssembler()
protected GelfSender createGelfSender()
public void reportError(String message, Exception e)
ErrorReporter
reportError
in interface ErrorReporter
message
- the messagee
- the exceptionprotected GelfMessage createGelfMessage(LogRecord record)
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 String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public int getGraylogPort()
public void setGraylogPort(int graylogPort)
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 isIncludeLogMessageParameters()
public void setIncludeLogMessageParameters(boolean includeLogMessageParameters)
public boolean isIncludeLocation()
public void setIncludeLocation(boolean includeLocation)
public String getTimestampPattern()
public void setTimestampPattern(String timestampPattern)
public int getMaximumMessageSize()
public void setMaximumMessageSize(int maximumMessageSize)
public String getVersion()
public void setVersion(String version)
Copyright © 2013–2023. All rights reserved.