mirror of
https://github.com/kieraneglin/pinchflat.git
synced 2026-01-23 02:24:24 +00:00
Stopped logging healthcheck requests (#659)
This commit is contained in:
parent
4554648ba7
commit
ee2db3e9b7
2 changed files with 9 additions and 2 deletions
|
|
@ -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.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue