public class GelfLayout
extends org.apache.log4j.Layout
{
"NDC": "ndc message",
"timestamp": "1439319236.722",
"SourceClassName": "biz.paluch.logging.gelf.wildfly.WildFlyGelfLogFormatterTest",
"SourceMethodName": "testDefaults",
"level": "6",
"SourceSimpleClassName": "WildFlyGelfLogFormatterTest",
"facility": "logstash-gelf",
"full_message": "foo bar test log message",
"short_message": "foo bar test log message",
"MySeverity": "INFO",
"LoggerName": "biz.paluch.logging.gelf.wildfly.WildFlyGelfLogFormatterTest",
"Thread": "main",
"MyTime": "2015-08-11 20:53:56,0722"
}
Following parameters are supported/needed:
System.getProperty("line.separator")
Time, Severity, ThreadName, SourceClassName, SourceMethodName, SourceSimpleClassName, LoggerName, NDC
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 formatter:
Modifier and Type | Field and Description |
---|---|
static String |
MULTI_VALUE_DELIMITTER |
static Set<LogMessageField.NamedLogField> |
SUPPORTED_FIELDS |
Constructor and Description |
---|
GelfLayout() |
public static final String MULTI_VALUE_DELIMITTER
public static final Set<LogMessageField.NamedLogField> SUPPORTED_FIELDS
public String format(org.apache.log4j.spi.LoggingEvent loggingEvent)
format
in class org.apache.log4j.Layout
public boolean ignoresThrowable()
ignoresThrowable
in class org.apache.log4j.Layout
public void activateOptions()
public void setFields(String fieldSpec)
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 boolean isMdcProfiling()
public void setMdcProfiling(boolean mdcProfiling)
public boolean isIncludeFullMdc()
public void setIncludeFullMdc(boolean includeFullMdc)
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 String getTimestampPattern()
public void setTimestampPattern(String timestampPattern)
public String getVersion()
public void setVersion(String version)
public String getLineBreak()
public void setLineBreak(String lineBreak)
Copyright © 2013–2023. All rights reserved.