Skip to content

Instantly share code, notes, and snippets.

@fjahr
Created April 24, 2018 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjahr/a93fecc07667637172f87d3ab8a53d52 to your computer and use it in GitHub Desktop.
Save fjahr/a93fecc07667637172f87d3ab8a53d52 to your computer and use it in GitHub Desktop.
Debugging Plug as a last resort for debugging nasty production issue in Elixir/Phoenix/AWS ECS Fargate
defmodule MyApp.Plugs.Debug do
@behaviour Plug
require Logger
def init(default), do: default
def call(conn, _) do
case conn.request_path do
"/path/to/error" ->
Logger.debug inspect(conn)
_ ->
nil
end
conn
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment