Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Program
try
{
Log.Information("Starting web host");
BuildWebHost(args).Run();
CreateWebHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
Expand All @@ -46,12 +46,11 @@ public class Program

**Then**, add `UseSerilog()` to the web host builder in `BuildWebHost()`.

```csharp
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseSerilog() // <-- Add this line
.Build();
```csharp
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseSerilog(); // <-- Add this line;
}
```

Expand Down