Stopped logging healthcheck requests (#659)

This commit is contained in:
Kieran
2025-03-17 14:48:07 -07:00
committed by GitHub
parent 4554648ba7
commit ee2db3e9b7
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -39,7 +39,10 @@ defmodule PinchflatWeb.Endpoint do
cookie_key: "request_logger"
plug Plug.RequestId
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
plug Plug.Telemetry,
event_prefix: [:phoenix, :endpoint],
log: {__MODULE__, :log_level, []}
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
@@ -55,6 +58,10 @@ defmodule PinchflatWeb.Endpoint do
plug PinchflatWeb.Router
# Disables logging in Plug.Telemetry for healthcheck requests
def log_level(%Plug.Conn{path_info: ["healthcheck"]}), do: false
def log_level(_), do: :info
# URLs need to be generated using the host of the current page being accessed
# for things like Podcast RSS feeds to contain links to the right location.
#
+1 -1
View File
@@ -68,7 +68,7 @@ defmodule PinchflatWeb.Router do
scope "/", PinchflatWeb do
pipe_through :api
get "/healthcheck", HealthController, :check
get "/healthcheck", HealthController, :check, log: false
end
scope "/dev" do