dotnet-cqrs/docs/observability/logging/correlation-ids.md

22 lines
398 B
Markdown

# Correlation IDs
Distributed tracing with correlation IDs.
## Usage
```csharp
using (CorrelationContext.Begin(correlationId))
{
_logger.LogEventPublished(eventId, eventType, streamName, CorrelationContext.Current);
await ProcessAsync();
}
```
## Propagation
Correlation IDs automatically propagate across async boundaries via AsyncLocal.
## See Also
- [Logging Overview](README.md)