fix: properly disable Plug.Telemetry logging for health checks
Set conn.private.log to false to prevent Plug.Telemetry from logging health check requests in addition to phoenix_log and plug_skip_telemetry.
This commit is contained in:
parent
5a63adacef
commit
fc63a4faaf
1 changed files with 3 additions and 1 deletions
|
|
@ -19,9 +19,11 @@ defmodule ToweropsWeb.Plugs.FilterNoisyLogs do
|
|||
def call(conn, _opts) do
|
||||
if should_filter?(conn) do
|
||||
# Setting phoenix_log to false prevents Phoenix.Logger from logging this request
|
||||
# Also disable telemetry logging
|
||||
# Setting log to false prevents Plug.Telemetry from logging
|
||||
# Setting plug_skip_telemetry skips telemetry events entirely
|
||||
conn
|
||||
|> put_private(:phoenix_log, false)
|
||||
|> put_private(:log, false)
|
||||
|> put_private(:plug_skip_telemetry, true)
|
||||
else
|
||||
conn
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue