Class TraceLoggingEnhancer (3.19.0)

public class TraceLoggingEnhancer implements LoggingEnhancer

Inheritance

java.lang.Object > TraceLoggingEnhancer

Implements

LoggingEnhancer

Static Methods

getCurrentSpanId()

public static String getCurrentSpanId()

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

Returns
Type Description
String

id The span ID

getCurrentTraceId()

public static String getCurrentTraceId()

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

Returns
Type Description
String

id The trace ID

getCurrentTraceSampled()

public static Boolean getCurrentTraceSampled()

Get the trace sampled flag associated with any logging done by the current thread.

Returns
Type Description
Boolean

traceSampled The traceSampled flag

setCurrentSpanId(String id)

public static void setCurrentSpanId(String id)

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

Parameter
Name Description
id String

The spanID

setCurrentTraceId(String id)

public static void setCurrentTraceId(String id)

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

Parameter
Name Description
id String

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

setCurrentTraceSampled(Boolean isTraceSampled)

public static void setCurrentTraceSampled(Boolean isTraceSampled)

Set the trace sampled flag associated with any logging done by the current thread.

Parameter
Name Description
isTraceSampled Boolean

The traceSampled flag

Constructors

TraceLoggingEnhancer()

public TraceLoggingEnhancer()

TraceLoggingEnhancer(String prefix)

public TraceLoggingEnhancer(String prefix)
Parameter
Name Description
prefix String

Methods

enhanceLogEntry(LogEntry.Builder builder)

public void enhanceLogEntry(LogEntry.Builder builder)
Parameter
Name Description
builder LogEntry.Builder