How to debug `Application my_app exited: shutdown` randomly?

Just following up here, I finally caught it. I enabled SASL logging and caught the supervisor’s crash message.

It’s not super relevant to the original question but in case anyone else stumbles upon this, the error I’m getting is:

[error] Child Plug.Cowboy.Drainer of Supervisor MyAppWeb.Endpoint shut down abnormally
** (exit) killed
Pid: #PID<0.1011.0>
Start Call: Plug.Cowboy.Drainer.start_link([refs: [MyAppWeb.Endpoint.HTTP]])
Restart: :permanent
Shutdown: 5000
Type: :worker

Without SASL logging enabled there was nothing else in the logs to indicate why the app had crashed.