File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ This is a simple example illustrating the use of Serilog with WebAPI.
2+
3+ The project was created with the following steps.
4+
5+ * Create the project and add NuGet dependencies
16```
27dotnet new webapi
38dotnet add package Serilog.Extensions.Logging
49dotnet add package Serilog.Sinks.Literate
5- ```
10+ ```
11+
12+ * Extend the logging to include Serilog. See ` Program.cs `
13+ ```
14+ .ConfigureLogging(log =>
15+ {
16+ log.AddSerilog(logger: Log.Logger, dispose: true);
17+ })
18+ ```
19+
20+ * Logging can then used directly to Serilog or via the ` Microsoft.Extensions.Logging ` pipeline.
Original file line number Diff line number Diff line change 1+ This is a simple example illustrating the use of Serilog with a web app.
2+
3+ The project was created with the following steps.
4+
5+ * Create the project and add NuGet dependencies
16```
27dotnet new web
38dotnet add package Serilog.Extensions.Logging
49dotnet add package Serilog.Sinks.Literate
5- ```
10+ ```
11+
12+ * Extend the logging to include Serilog. See ` Program.cs `
13+ ```
14+ .ConfigureLogging(log =>
15+ {
16+ log.AddSerilog(logger: Log.Logger, dispose: true);
17+ })
18+ ```
19+
20+ * Logging can then used directly to Serilog or via the ` Microsoft.Extensions.Logging ` pipeline.
You can’t perform that action at this time.
0 commit comments