Skip to content

Commit d11e20c

Browse files
authored
Add performance notes to the README [Skip CI]
1 parent 7bbf29e commit d11e20c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ To write events to the file in an alternative format such as JSON, pass an `ITex
146146
.WriteTo.RollingFile(new JsonFormatter(), "log-{Date}.txt")
147147
```
148148

149+
### Performance
150+
151+
By default, the rolling file sink will flush each event written through it to disk. To improve write performance, specifying `buffered: true` will permit the underlying stream to buffer writes.
152+
153+
The [Serilog.Sinks.Async](https://github.com/serilog/serilog-sinks-async) package can be used to wrap the rolling file sink and perform all disk accss on a background worker thread.
154+
149155
### Alternatives
150156

151157
The default rolling file sink is designed to suit most applications. So that we can keep it maintainable and reliable, it does not provide a large range of optional behavior. Check out alternative implemementations like [this one](https://github.com/BedeGaming/sinks-rollingfile) if your needs aren't met by the default version.

0 commit comments

Comments
 (0)