public class StackdriverJsonLayout
extends JsonLayout
Modifier and Type | Field and Description |
---|---|
static String |
MDC_FIELD_SPAN_EXPORT
The name of the MDC parameter, Spring Sleuth is storing the span export information at
|
static String |
MDC_FIELD_SPAN_ID
The name of the MDC parameter, Spring Sleuth is storing the span id at
|
static String |
MDC_FIELD_TRACE_ID
The name of the MDC parameter, Spring Sleuth is storing the trace id at
|
static String |
SEVERITY_ATTRIBUTE
The JSON field name for the log level (severity)
|
static String |
SPAN_ID_ATTRIBUTE
The JSON field name for the span-id
|
static String |
TIMESTAMP_NANOS_ATTRIBUTE
The JSON field name for the nanos of the timestamp
|
static String |
TIMESTAMP_SECONDS_ATTRIBUTE
The JSON field name for the seconds of the timestamp
|
static String |
TRACE_ID_ATTRIBUTE
The JSON field name for the trace-id
|
Constructor and Description |
---|
StackdriverJsonLayout()
creates a layout for a Logback appender compatible to the Stackdriver log format
|
Modifier and Type | Method and Description |
---|---|
String |
getProjectId() |
boolean |
isIncludeExceptionInMessage() |
boolean |
isIncludeSpanId() |
boolean |
isIncludeTraceId() |
void |
setIncludeExceptionInMessage(boolean includeExceptionInMessage) |
void |
setIncludeSpanId(boolean includeSpanId) |
void |
setIncludeTraceId(boolean includeTraceId) |
void |
setProjectId(String projectId) |
protected Map<String,Object> |
toJsonMap(ch.qos.logback.classic.spi.ILoggingEvent event) |
public static final String SEVERITY_ATTRIBUTE
public static final String TIMESTAMP_SECONDS_ATTRIBUTE
public static final String TIMESTAMP_NANOS_ATTRIBUTE
public static final String SPAN_ID_ATTRIBUTE
public static final String TRACE_ID_ATTRIBUTE
public static final String MDC_FIELD_TRACE_ID
public static final String MDC_FIELD_SPAN_ID
public static final String MDC_FIELD_SPAN_EXPORT
public StackdriverJsonLayout()
public String getProjectId()
public void setProjectId(String projectId)
projectId
- the Google Cloud project id relevant for logging the traceIdpublic boolean isIncludeTraceId()
public void setIncludeTraceId(boolean includeTraceId)
includeTraceId
- true if the traceId should be included into the JSONpublic boolean isIncludeSpanId()
public void setIncludeSpanId(boolean includeSpanId)
includeSpanId
- true if the spanId should be included into the JSONpublic boolean isIncludeExceptionInMessage()
public void setIncludeExceptionInMessage(boolean includeExceptionInMessage)
includeExceptionInMessage
- true if the exception should be added to the messageCopyright © 2018 Pivotal Software, Inc.. All rights reserved.