Skip to content

Commit 8f8d105

Browse files
authored
Merge pull request #104 from nblumhardt/split-hosting
Split out the ASP.NET Core 2.0 host integration
2 parents 5e359d9 + 85570a5 commit 8f8d105

14 files changed

+10
-350
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
A Serilog provider for [Microsoft.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging), the logging subsystem used by ASP.NET Core.
55

6-
This package routes ASP.NET log messages through Serilog, so you can get information about ASP.NET's internal operations logged to the same Serilog sinks as your application events.
6+
### ASP.NET Core 2.0+ Instructions
77

8-
### Instructions
8+
ASP.NET Core 2.0 applications should prefer [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore) and `UseSerilog()` instead.
99

10-
**First**, install the _Serilog.Extensions.Logging_ [NuGet package](https://www.nuget.org/packages/Serilog.Extensions.Logging) into your web or console app. You will need a way to view the log messages - _Serilog.Sinks.Literate_ writes these to the console.
10+
### ASP.NET Core 1.0, 1.1, and Default Provider Integration
11+
12+
The package implements `AddSerilog()` on `ILoggingBuilder` and `ILoggerFactory` to enable the Serilog provider under the default _Microsoft.Extensions.Logging_ implementation.
13+
14+
**First**, install the _Serilog.Extensions.Logging_ [NuGet package](https://www.nuget.org/packages/Serilog.Extensions.Logging) into your web or console app. You will need a way to view the log messages - _Serilog.Sinks.Console_ writes these to the console.
1115

1216
```powershell
1317
Install-Package Serilog.Extensions.Logging -DependencyVersion Highest
@@ -32,7 +36,7 @@ public class Startup
3236
```
3337

3438
**Finally**, in your `Startup` class's `Configure()` method, remove the existing logger configuration entries and
35-
call `AddSerilog()` on the provided `loggerFactory`.
39+
call `AddSerilog()` on the provided `loggingBuilder`.
3640

3741
```csharp
3842
public void ConfigureServices(IServiceCollection services)

samples/SimpleWebSample/Controllers/ScopesController.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

samples/SimpleWebSample/Controllers/ValuesController.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

samples/SimpleWebSample/Program.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

samples/SimpleWebSample/Properties/launchSettings.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

samples/SimpleWebSample/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

samples/SimpleWebSample/SimpleWebSample.csproj

Lines changed: 0 additions & 22 deletions
This file was deleted.

samples/SimpleWebSample/Startup.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

samples/SimpleWebSample/appsettings.Development.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/SimpleWebSample/appsettings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)