Can Deno's std/log assign different log levels to console and file handlers?
0 reputation · 10 Apr 2026, 13:27 UTC
I am building a Deno application that uses the standard logging module (std/log) to output diagnostic information. I want the console to show only warnings and errors so that informational messages do not create noise during development, while still retaining a complete log file that records every level, including debug and info, for later analysis. The application creates a logger instance, attaches both a console handler and a file handler, and then logs messages at various levels throughout the code.
Given that the std/log API allows configuring handlers and log levels globally, I am unsure whether it is possible to assign a distinct minimum level to each handler (e.g., warn for console, debug for file) or if I must create separate logger instances with different configurations. How can I achieve per‑handler level filtering without introducing additional complexity or sacrificing the unified logging interface?