[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class TraceLoggingEnhancer (3.23.2)\n\nVersion latestkeyboard_arrow_down\n\n- [3.23.2 (latest)](/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.23.1](/java/docs/reference/google-cloud-logging/3.23.1/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.22.6](/java/docs/reference/google-cloud-logging/3.22.6/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.21.4](/java/docs/reference/google-cloud-logging/3.21.4/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.20.7](/java/docs/reference/google-cloud-logging/3.20.7/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.19.0](/java/docs/reference/google-cloud-logging/3.19.0/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.18.0](/java/docs/reference/google-cloud-logging/3.18.0/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.17.2](/java/docs/reference/google-cloud-logging/3.17.2/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.16.2](/java/docs/reference/google-cloud-logging/3.16.2/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.15.17](/java/docs/reference/google-cloud-logging/3.15.17/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.14.9](/java/docs/reference/google-cloud-logging/3.14.9/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.13.7](/java/docs/reference/google-cloud-logging/3.13.7/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.12.1](/java/docs/reference/google-cloud-logging/3.12.1/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.11.10](/java/docs/reference/google-cloud-logging/3.11.10/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.10.7](/java/docs/reference/google-cloud-logging/3.10.7/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.9.0](/java/docs/reference/google-cloud-logging/3.9.0/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.8.0](/java/docs/reference/google-cloud-logging/3.8.0/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.7.6](/java/docs/reference/google-cloud-logging/3.7.6/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.6.4](/java/docs/reference/google-cloud-logging/3.6.4/com.google.cloud.logging.TraceLoggingEnhancer)\n- [3.5.3](/java/docs/reference/google-cloud-logging/3.5.3/com.google.cloud.logging.TraceLoggingEnhancer) \n\n public class TraceLoggingEnhancer implements LoggingEnhancer\n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e TraceLoggingEnhancer \n\nImplements\n----------\n\n[LoggingEnhancer](/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.LoggingEnhancer) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### getCurrentSpanId()\n\n public static String getCurrentSpanId()\n\nGet the Span ID associated with any logging done by the current thread.\n\n### getCurrentTraceId()\n\n public static String getCurrentTraceId()\n\nGet the Trace ID associated with any logging done by the current thread.\n\n### getCurrentTraceSampled()\n\n public static Boolean getCurrentTraceSampled()\n\nGet the trace sampled flag associated with any logging done by the current thread.\n\n### setCurrentSpanId(String id)\n\n public static void setCurrentSpanId(String id)\n\nSet the Span ID associated with any logging done by the current thread.\n\n### setCurrentTraceId(String id)\n\n public static void setCurrentTraceId(String id)\n\nSet the Trace ID associated with any logging done by the current thread.\n\n### setCurrentTraceSampled(Boolean isTraceSampled)\n\n public static void setCurrentTraceSampled(Boolean isTraceSampled)\n\nSet the trace sampled flag associated with any logging done by the current thread.\n\nConstructors\n------------\n\n### TraceLoggingEnhancer()\n\n public TraceLoggingEnhancer()\n\n### TraceLoggingEnhancer(String prefix)\n\n public TraceLoggingEnhancer(String prefix)\n\nMethods\n-------\n\n### enhanceLogEntry(LogEntry.Builder builder)\n\n public void enhanceLogEntry(LogEntry.Builder builder)"]]