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 Trace ID associated with any logging done by the current thread.static voidSet the Trace ID 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]
-
getCurrentTraceId
Get the Trace ID associated with any logging done by the current thread.- Returns:
- id The traceID
-
enhanceLogEntry
- Specified by:
enhanceLogEntryin interfaceLoggingEnhancer
-