Package com.google.cloud.logging
Class TraceLoggingEnhancer
java.lang.Object
com.google.cloud.logging.TraceLoggingEnhancer
- All Implemented Interfaces:
LoggingEnhancer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enhanceLogEntry
(LogEntry.Builder builder) static String
Get the Trace ID associated with any logging done by the current thread.static void
Set 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:
enhanceLogEntry
in interfaceLoggingEnhancer
-