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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.