31 lines
480 B
Markdown
31 lines
480 B
Markdown
# Serilog Integration
|
|
|
|
Structured logging with Serilog.
|
|
|
|
## Configuration
|
|
|
|
```csharp
|
|
Log.Logger = new LoggerConfiguration()
|
|
.MinimumLevel.Debug()
|
|
.Enrich.FromLogContext()
|
|
.WriteTo.Console()
|
|
.WriteTo.Seq("http://localhost:5341")
|
|
.CreateLogger();
|
|
|
|
builder.Host.UseSerilog();
|
|
```
|
|
|
|
## Querying
|
|
|
|
```sql
|
|
-- Seq query for correlation ID
|
|
CorrelationId = "abc-123-def"
|
|
|
|
-- Query by event type
|
|
EventType = "OrderPlaced"
|
|
```
|
|
|
|
## See Also
|
|
|
|
- [Logging Overview](README.md)
|