Production logs are silent: default filter hides all warn! diagnostics #7

Open
opened 2026-10-02 11:13:51 +00:00 by mat · 0 comments
Owner

Context

While diagnosing a production 502 on high-resolution tiles, docker logs canicule was completely empty — no startup line, no tracing::warn! — even though the proxy was actively failing every authenticated tile request with could not refresh Strava cookies / Strava tile request failed.

Cause

proxy/src/main.rs calls tracing_subscriber::fmt::init(). With RUST_LOG unset (the normal deployment case), the default EnvFilter shows only ERROR-level events, so every warn! the tile path emits is silently dropped. The logs are effectively always empty in production.

Proposal

Default the filter to info when RUST_LOG is absent, e.g. in main():

tracing_subscriber::fmt()
    .with_env_filter(
        tracing_subscriber::EnvFilter::try_from_default_env()
            .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
    )
    .init();

(RUST_LOG still overrides for quieter/verbose deployments.) Optionally document RUST_LOG in the README configuration table.

Acceptance

  • With no RUST_LOG set, starting the binary logs the listening line.
  • A failing authenticated tile fetch logs a WARN line visible in docker logs.
  • With RUST_LOG=error, behaviour stays quiet (override respected).
## Context While diagnosing a production 502 on high-resolution tiles, `docker logs canicule` was completely empty — no startup line, no `tracing::warn!` — even though the proxy was actively failing every authenticated tile request with `could not refresh Strava cookies` / `Strava tile request failed`. ## Cause `proxy/src/main.rs` calls `tracing_subscriber::fmt::init()`. With `RUST_LOG` unset (the normal deployment case), the default `EnvFilter` shows only `ERROR`-level events, so every `warn!` the tile path emits is silently dropped. The logs are effectively always empty in production. ## Proposal Default the filter to `info` when `RUST_LOG` is absent, e.g. in `main()`: ```rust tracing_subscriber::fmt() .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env() .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), ) .init(); ``` (`RUST_LOG` still overrides for quieter/verbose deployments.) Optionally document `RUST_LOG` in the README configuration table. ## Acceptance - With no `RUST_LOG` set, starting the binary logs the `listening` line. - A failing authenticated tile fetch logs a `WARN` line visible in `docker logs`. - With `RUST_LOG=error`, behaviour stays quiet (override respected).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/canicule#7
No description provided.