Skip to content

Commit 942f35f

Browse files
authored
Show .NET Core 2.0 syntax [Skip CI]
1 parent 7bda6f2 commit 942f35f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,10 @@ public class Startup
3535
call `AddSerilog()` on the provided `loggerFactory`.
3636

3737
```csharp
38-
public void Configure(IApplicationBuilder app,
39-
IHostingEnvironment env,
40-
ILoggerFactory loggerfactory,
41-
IApplicationLifetime appLifetime)
38+
public void ConfigureServices(IServiceCollection services)
4239
{
43-
loggerfactory.AddSerilog();
44-
45-
// Ensure any buffered events are sent at shutdown
46-
appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);
40+
services.AddLogging(loggingBuilder =>
41+
loggingBuilder.AddSerilog(dispose: true));
4742
```
4843

4944
That's it! With the level bumped up a little you should see log output like:

0 commit comments

Comments
 (0)