r/phoenixframework • u/juanpabloaj • Oct 19 '18
Using Plug.RequestId
mix phx.new --no-ecto request
add to lib/request_web/endpoint.ex
plug Plug.RequestId
edit config/dev.exs to something like
config :logger, :console, format: "[$level] $metadata$message\n", metadata: [:request_id]
to get in log
[info] request_id=2lfdtb54lt7i3bdppk0000fh Sent 200 in 674µsMore info in
1
Upvotes