Instrumenting a .NET C# application

 Let's now instrument our sample C# application:

  1. First, navigate to the project folder, from where you'll open VS Code:
$ cd ~/fod/ch06/dotnet$ code .
  1. Next, we need to add a NuGet package containing the logging library to the project:
$ dotnet add package Microsoft.Extensions.Logging

This should add the following line to your dotnet.csproj project file:

<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
  1. Open the Program.cs class and notice that we call the CreateDefaultBuilder(args) method on line 21:

Configuring logging in ASP.NET Core 2.2

This method, by default, adds a few ...

Get Learn Docker - Fundamentals of Docker 19.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.