20231222 20240127 #### references https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line https://learn.microsoft.com/en-us/samples/dotnet/samples/csharp-logging-fundamentals/ https://github.com/dotnet/samples/tree/main/core/logging #### Log category 建立 ILogger 時, 需指定 category. 習慣上, category 建議命名為 namespace.class 如下例為 "Example.DefaultService": ZLib 以 ProjectID 對應 category namespace Example { public class DefaultService : IService { private readonly ILogger _logger; public DefaultService(ILogger logger) => _logger = logger; // ... } } #### LogLevel LogLevel indicates the severity of the log and ranges from 0 to 6: Trace = 0, Debug = 1, Information = 2, Warning = 3, Error = 4, Critical = 5, and None = 6.