diff --git a/lib/pinchflat_web/endpoint.ex b/lib/pinchflat_web/endpoint.ex index 908699e..bf094ed 100644 --- a/lib/pinchflat_web/endpoint.ex +++ b/lib/pinchflat_web/endpoint.ex @@ -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. # diff --git a/lib/pinchflat_web/router.ex b/lib/pinchflat_web/router.ex index bdbb17e..9586f13 100644 --- a/lib/pinchflat_web/router.ex +++ b/lib/pinchflat_web/router.ex @@ -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