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-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ A Serilog provider for [Microsoft.Extensions.Logging](https://www.nuget.org/pack
5
5
6
6
### ASP.NET Core 2.0+ Instructions
7
7
8
-
ASP.NET Core 2.0 applications should prefer [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore) and `UseSerilog()` instead.
8
+
**ASP.NET Core 2.0 applications should prefer [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore) and `UseSerilog()` instead.**
9
9
10
-
### ASP.NET Core 1.0, 1.1, and Default Provider Integration
10
+
### ASP.NET Core 1.0, 1.1 and Default Provider Integration
11
11
12
12
The package implements `AddSerilog()` on `ILoggingBuilder` and `ILoggerFactory` to enable the Serilog provider under the default _Microsoft.Extensions.Logging_ implementation.
13
13
@@ -35,7 +35,7 @@ public class Startup
35
35
// Other startup code
36
36
```
37
37
38
-
**Finally**, inyour `Startup` class's `Configure()` method, remove the existing logger configuration entries and
38
+
**Finally, for .NET Core 2.0+**, in your `Startup` class's `Configure()` method, removetheexistingloggerconfigurationentriesand
@@ -48,6 +48,20 @@ call `AddSerilog()` on the provided `loggingBuilder`.
48
48
}
49
49
```
50
50
51
+
**For .NETCore1.0or1.1**, inyour `Startup` class's `Configure()` method, remove the existing logger configuration entries and call `AddSerilog()` on the provided `loggerFactory`.
52
+
53
+
```
54
+
publicvoidConfigure(IApplicationBuilderapp,
55
+
IHostingEnvironmentenv,
56
+
ILoggerFactoryloggerfactory,
57
+
IApplicationLifetimeappLifetime)
58
+
{
59
+
loggerfactory.AddSerilog();
60
+
61
+
// Ensure any buffered events are sent at shutdown
0 commit comments