# MDC Instrumentation for Logback version 1.0 and higher
This module integrates instrumentation with Logback by injecting the trace ID and span ID from a
mounted span using a custom Logback appender.
## Quickstart
### Add these dependencies to your project
Replace `OPENTELEMETRY_VERSION` with the [latest
release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20AND%20a:opentelemetry-logback-mdc-1.0).
For Maven, add to your `pom.xml` dependencies:
```xml
io.opentelemetry.instrumentation
opentelemetry-logback-mdc-1.0
OPENTELEMETRY_VERSION
```
For Gradle, add to your dependencies:
```kotlin
dependencies {
runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-logback-mdc-1.0:OPENTELEMETRY_VERSION")
}
```
### Usage
logback.xml:
```xml
%d{HH:mm:ss.SSS} trace_id=%X{trace_id} span_id=%X{span_id} trace_flags=%X{trace_flags} %msg%n
...
```
Logging events will automatically have context information from the span context injected. The
following attributes are available for use:
- `trace_id`
- `span_id`
- `trace_flags`