Class TraceLoggingEventEnhancer (0.130.30-alpha)

public class TraceLoggingEventEnhancer implements LoggingEventEnhancer

Adds support for grouping logs by incoming http request

Inheritance

java.lang.Object > TraceLoggingEventEnhancer

Static Methods

clearTraceId()

public static void clearTraceId()

Clearing a trace Id from the MDC

getCurrentTraceId()

public static String getCurrentTraceId()

Get the Trace ID associated with any logging done by the current thread.

Returns
TypeDescription
String

id The traceID

setCurrentTraceId(String id)

public static void setCurrentTraceId(String id)

Set the Trace ID associated with any logging done by the current thread.

Parameter
NameDescription
idString

The traceID, in the form projects/[PROJECT_ID]/traces/[TRACE_ID]

Constructors

TraceLoggingEventEnhancer()

public TraceLoggingEventEnhancer()

Methods

enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e)

public void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e)
Parameters
NameDescription
buildercom.google.cloud.logging.LogEntry.Builder
ech.qos.logback.classic.spi.ILoggingEvent