You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ Install from [NuGet](https://nuget.org/packages/serilog.sinks.async):
12
12
Install-Package Serilog.Sinks.Async
13
13
```
14
14
15
-
Assuming you have already installed the target sink, such as the rolling file sink, move the wrapped sink's configuration within a `WriteTo.Async()` statement:
15
+
Assuming you have already installed the target sink, such as the file sink, move the wrapped sink's configuration within a `WriteTo.Async()` statement:
@@ -26,7 +26,7 @@ Log.Information("This will be written to disk on the worker thread");
26
26
Log.CloseAndFlush();
27
27
```
28
28
29
-
The wrapped sink (`RollingFile` in this case) will be invoked on a worker thread while your application's thread gets on with more important stuff.
29
+
The wrapped sink (`File` in this case) will be invoked on a worker thread while your application's thread gets on with more important stuff.
30
30
31
31
Because the memory buffer may contain events that have not yet been written to the target sink, it is important to call `Log.CloseAndFlush()` or `Logger.Dispose()` when the application exits.
32
32
@@ -36,7 +36,19 @@ The default memory buffer feeding the worker thread is capped to 10,000 items, a
Warning: For the same reason one typically does not want exceptions from logging to leak into the execution path, one typically does not want a logger to be able to have the side-efect of actually interrupting application processing until the log propagation has been unblocked.
45
+
46
+
When the buffer size limit is reached, the default behavior is to drop any further attempted writes until the queue abates, reporting each such failure to the `Serilog.Debugging.SelfLog`. To replace this with a blocking behaviour, set `blockWhenFull` to `true`.
47
+
48
+
```csharp
49
+
// Wait for any queued event to be accepted by the `File` log before allowing the calling thread
50
+
// to resume its application work after a logging call when there are 10,000 LogEvents waiting
0 commit comments