Cannot silence Phoenix.Logger with "config :phoenix, :logger, false"

I have an umbrella app (Phoenix 1.7) with 4 or 5 different endpoints. On each one I added Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

The Phoenix.Logger does print out the start and stop events on the logger. All good, but I want to be able to show WHICH endpoint is reporting, and you can’t customize the format in Phoenix.Logger. So I want to copy-paste the code from that module and create my own logger. But first I want to stop the Phoenix.Logger. Using config :phoenix, :logger, false per the docs doesn’t work (in config.exs or runtime.exs).

Any ideas what I’m doing wrong? Or is it a bug?

Guess I can just change the prefix and catch the telemetry events with the new prefix(es) in my copied logger module. Apparently only events prefixed with the standard [:phoenix, :endpoint] are printed by the Phoenix.Logger module.

Of course I found the problem later: one of my umbrella apps still had the obsolete Plug.Router installed, as well as Plug.Telemetry.

1 Like