public class StackdriverJsonLayout
extends JsonLayout
Constructor and Description |
---|
StackdriverJsonLayout()
creates a layout for a Logback appender compatible to the Stackdriver log format
|
Modifier and Type | Method and Description |
---|---|
protected String |
formatTraceId(String traceId) |
String |
getProjectId() |
boolean |
isIncludeExceptionInMessage() |
boolean |
isIncludeSpanId() |
boolean |
isIncludeTraceId() |
void |
setIncludeExceptionInMessage(boolean includeExceptionInMessage) |
void |
setIncludeSpanId(boolean includeSpanId) |
void |
setIncludeTraceId(boolean includeTraceId) |
void |
setProjectId(String projectId) |
void |
start() |
protected Map<String,Object> |
toJsonMap(ch.qos.logback.classic.spi.ILoggingEvent event) |
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 messagepublic void start()
protected Map<String,Object> toJsonMap(ch.qos.logback.classic.spi.ILoggingEvent event)
event
- the logging eventCopyright © 2018 Pivotal Software, Inc.. All rights reserved.