Skip to content

Commit f2351f2

Browse files
authored
Note the use of Serilog.Sinks.Async to move writes to background thread [skip ci]
1 parent 59fe4b1 commit f2351f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ To configure the console sink with a different theme and include the `SourceCont
157157
}
158158
```
159159

160+
### Performance
161+
162+
Console logging is synchronous and this can cause bottlenecks in some deployment scenarios. For high-volume console logging, consider using [_Serilog.Sinks.Async_](https://github.com/serilog/serilog-sinks-async) to move console writes to a background thread:
163+
164+
```csharp
165+
// dotnet add package serilog.sinks.async
166+
167+
Log.Logger = new LoggerConfiguration()
168+
.WriteTo.Async(wt => wt.Console())
169+
.CreateLogger();
170+
```
171+
160172
### Contributing
161173

162174
Would you like to help make the Serilog console sink even better? We keep a list of issues that are approachable for newcomers under the [up-for-grabs](https://github.com/serilog/serilog-sinks-console/issues?labels=up-for-grabs&state=open) label. Before starting work on a pull request, we suggest commenting on, or raising, an issue on the issue tracker so that we can help and coordinate efforts. For more details check out our [contributing guide](CONTRIBUTING.md).

0 commit comments

Comments
 (0)