We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CloseAndFlush()
1 parent 1332279 commit d474914Copy full SHA for d474914
README.md
@@ -38,9 +38,13 @@ call `AddSerilog()` on the provided `loggerFactory`.
38
```csharp
39
public void Configure(IApplicationBuilder app,
40
IHostingEnvironment env,
41
- ILoggerFactory loggerfactory)
+ ILoggerFactory loggerfactory,
42
+ IApplicationLifetime appLifetime)
43
{
44
loggerfactory.AddSerilog();
45
+
46
+ // Ensure any buffered events are sent at shutdown
47
+ appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);
48
```
49
50
That's it! With the level bumped up a little you should see log output like:
0 commit comments