Let's learn how to verify our implemented logging. The dependency injection system of the ILogger interface helps us to mock the logging mechanism and validate the resulting implementation. It is essential to note that our handlers are using the extension methods of the ILogger interface. Let's use the ASP.NET Core implementation of the LogInformation extension method in the Microsoft.Extensions.Logging namespace as an example:
using Microsoft.Extensions.Logging.Internal;using System;namespace Microsoft.Extensions.Logging{ /// <summary>ILogger extension methods for common scenarios.</summary> public static class LoggerExtensions { public static void LogInformation(this ILogger logger, Exception exception, string ...