Skip to content

Commit 4ec0cc2

Browse files
authored
One more outdated README example [skip ci]
1 parent 21bb78a commit 4ec0cc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ You can alternatively configure Serilog using a delegate as shown below:
7171

7272
```csharp
7373
// dotnet add package Serilog.Settings.Configuration
74-
.UseSerilog((hostingContext, services, loggerConfiguration) => loggerConfiguration
75-
.ReadFrom.Configuration(hostingContext.Configuration)
76-
.Enrich.FromLogContext()
77-
.WriteTo.Console())
74+
builder.Services.AddSerilog((services, loggerConfiguration) => loggerConfiguration
75+
.ReadFrom.Configuration(builder.Configuration)
76+
.Enrich.FromLogContext()
77+
.WriteTo.Console())
7878
```
7979

80-
This has the advantage of making the `hostingContext`'s `Configuration` object available for configuration of the logger, but at the expense of ignoring `Exception`s raised earlier in program startup.
80+
This has the advantage of making `builder`'s `Configuration` object available for configuration of the logger, but at the expense of ignoring `Exception`s raised earlier in program startup.
8181

8282
If this method is used, `Log.Logger` is assigned implicitly, and closed when the app is shut down.

0 commit comments

Comments
 (0)