Package com.google.cloud.logging
Class TraceLoggingEnhancer
java.lang.Object
com.google.cloud.logging.TraceLoggingEnhancer
- All Implemented Interfaces:
LoggingEnhancer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenhanceLogEntry(LogEntry.Builder builder) static StringGet the Span ID associated with any logging done by the current thread.static StringGet the Trace ID associated with any logging done by the current thread.static BooleanGet the trace sampled flag associated with any logging done by the current thread.static voidSet the Span ID associated with any logging done by the current thread.static voidSet the Trace ID associated with any logging done by the current thread.static voidsetCurrentTraceSampled(Boolean isTraceSampled) Set the trace sampled flag associated with any logging done by the current thread.
-
Constructor Details
-
TraceLoggingEnhancer
public TraceLoggingEnhancer() -
TraceLoggingEnhancer
-
-
Method Details
-
setCurrentTraceId
Set the Trace ID associated with any logging done by the current thread.- Parameters:
id- The traceID, in the form projects/[PROJECT_ID]/traces/[TRACE_ID]
-
setCurrentSpanId
Set the Span ID associated with any logging done by the current thread.- Parameters:
id- The spanID
-
setCurrentTraceSampled
Set the trace sampled flag associated with any logging done by the current thread.- Parameters:
isTraceSampled- The traceSampled flag
-
getCurrentTraceId
Get the Trace ID associated with any logging done by the current thread.- Returns:
- id The trace ID
-
getCurrentSpanId
Get the Span ID associated with any logging done by the current thread.- Returns:
- id The span ID
-
getCurrentTraceSampled
Get the trace sampled flag associated with any logging done by the current thread.- Returns:
- traceSampled The traceSampled flag
-
enhanceLogEntry
- Specified by:
enhanceLogEntryin interfaceLoggingEnhancer
-