Class TraceLoggingEnhancer (3.14.4)

See more code actions.
public class TraceLoggingEnhancer implements LoggingEnhancer
java.lang.Object > TraceLoggingEnhancer
LoggingEnhancer

Static Methods

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

TraceLoggingEnhancer()

public TraceLoggingEnhancer()

TraceLoggingEnhancer(String prefix)

public TraceLoggingEnhancer(String prefix)
Parameter
NameDescription
prefixString

Methods

enhanceLogEntry(LogEntry.Builder builder)

public void enhanceLogEntry(LogEntry.Builder builder)
Parameter
NameDescription
builderLogEntry.Builder