Skip to content

Commit 0250994

Browse files
authored
Update README.md
1 parent 926e42c commit 0250994

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Serilog.Sinks.Async [![Build status](https://ci.appveyor.com/api/projects/status/rostpmo2gq08ecag?svg=true)](https://ci.appveyor.com/project/mindkin/serilog-sinks-async)
22
An async Serilog sink
33

4-
Use this buffered async delegating sink to reduce the time it takes to write your log events to a sink.
5-
This sink can work with any `IEventLogSink`. Especially suited to sinks that are either slow to write or wait on I/O (like databases, files systems etc). This sink uses a separate thread pool thread to execute your sink, freeing up the calling thread to run in your app.
4+
Use this buffered, async, delegating, sink to reduce the time it takes for your app to write your log events to your sinks. This sink can work with any `IEventLogSink` you use.
5+
Especially suited to sinks that are either slow to write or have I/O bottlenecks (like http, databases, file writes etc.).
6+
This sink uses a separate thread pool thread to write to your sink, freeing up the calling thread to run in your app without having to wait.
7+
Utilizes the producer/consumer pattern (using the TPL `BufferBlock<T>` class), where the calling thread produces log events (on your main thread), and the consumer runs on a thread pool thread consuming log events and writing them to your sink.
68

79
Install from NuGet:
810

@@ -21,9 +23,9 @@ Log.Logger = new LoggerConfiguration()
2123

2224
Now `YourSink` will write messages using another [thread pool] thread while your logging thread gets on with more important stuff.
2325

24-
If you think your code is logging faster than your sink can handle, then the buffer is going to grow in memory.
25-
Set a maximum size of the buffer so that your machine memory is not filled up.
26-
Buffered logevents are then (async) postponed until your sink catches up.
26+
If you think your code is producing log events faster than your sink can consume and write them, then the buffer is going to grow in memory, until you run out!
27+
Set a maximum size of the buffer so that your memory is not filled up.
28+
Buffered log events are then (async) postponed in your app thread until your sink catches up.
2729

2830
```csharp
2931
Log.Logger = new LoggerConfiguration()

0 commit comments

Comments
 (0)