github Listenarrs/Listenarr v1.3.10-canary
Canary 1.3.10

pre-release5 hours ago

🔍 The Problem

When setting LISTENARR_LOG_LEVEL=Trace, the application silently drops logging verbosity to Information rather than raising it to maximum diagnostic detail. During troubleshooting scenarios, this silent fallback concealed critical diagnostic events—logging only 124 lines compared to 205 lines under debug/verbose levels, obscuring the underlying causes of failures.

In listenarr.api/Startup/ListenarrBuilderFactory.cs (ConfigureSerilog), log level strings from both the LISTENARR_LOG_LEVEL environment variable and configuration (Serilog:MinimumLevel:Default or Logging:LogLevel:Default) were parsed directly via Enum.TryParse<LogEventLevel>. Unlike Microsoft.Extensions.Logging where Trace denotes level 0 (the most verbose level), Serilog's LogEventLevel enum defines Verbose as level 0 and lacks a Trace member (and defines Fatal rather than Critical). Because Enum.TryParse<LogEventLevel>("Trace", ...) returned false, execution silently fell through to the default fallback LogEventLevel.Information without issuing any warnings or alerts. Consequently, setting LISTENARR_LOG_LEVEL=Trace inadvertently suppressed all Verbose and Debug logs.

🛠️ The Solution

  • Implemented TryParseLogLevel in listenarr.api/Startup/ListenarrBuilderFactory.cs to trim input whitespace, map .NET standard aliases (Trace to LogEventLevel.Verbose and Critical to LogEventLevel.Fatal) case-insensitively, and delegate standard levels to Enum.TryParse<LogEventLevel>.

  • Implemented ResolveMinimumLevel in ListenarrBuilderFactory.cs with deterministic precedence (LISTENARR_LOG_LEVEL environment variable takes precedence over configuration), linear fallback to LogEventLevel.Information, and a decoupled warning logger delegate.

  • Added structured diagnostic console warnings ([Listenarr] Warning: Unrecognized log level...) when invalid or mistyped log levels are supplied via environment...


Automated Canary build

Don't miss a new Listenarr release

NewReleases is sending notifications on new releases.