# Class TraceLoggingEventEnhancer (0.142.0-alpha)

0.142.0-alpha (latest) 0.140.0-alpha 0.137.0-alpha 0.136.0-alpha 0.134.0-alpha 0.133.0-alpha 0.132.21-alpha 0.131.17-alpha 0.130.30-alpha 0.129.10-alpha 0.128.0-alpha 0.127.16-alpha 0.126.0-alpha 0.125.3-alpha 0.124.0-alpha 0.123.12-alpha 0.122.9-alpha

    public class TraceLoggingEventEnhancer implements LoggingEventEnhancer

Adds support for grouping logs by incoming http request

## Inheritance

java.lang.Object \> TraceLoggingEventEnhancer

## Implements

[LoggingEventEnhancer](https://docs.cloud.google.com/java/docs/reference/google-cloud-logging-logback/latest/com.google.cloud.logging.logback.LoggingEventEnhancer)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### clearTraceId()

    public static void clearTraceId()

Clearing a trace Id from the MDC

### getCurrentTraceId()

    public static String getCurrentTraceId()

Get the Trace ID associated with any logging done by the current thread.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | 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** ||
|---|---|
| **Name** | **Description** |
| `id` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The traceID, in the form projects/\[PROJECT_ID\]/traces/\[TRACE_ID\] |

## Constructors

### TraceLoggingEventEnhancer()

    public TraceLoggingEventEnhancer()

## Methods

### enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e)

    public void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `builder` | `com.google.cloud.logging.LogEntry.Builder` |
| `e` | `ch.qos.logback.classic.spi.ILoggingEvent` |