How to show stacktrace in logs in Phoenix production app?

Hi, I deployed my app to production using distillery, when I check the log var/log/erlang.log.1, only able to see

04:03:29.504 request_id=FhDvUq-23VwxBVkAAAHh [info] Sent 500 in 2626ms

Is there a way to show error stacktrace?

You could try enabling handle_sasl_reports in your Logger config:

@dom Thanks. I tried enable handle_sasl_reports, but no luck, no stacktrace showed in logs.

I think this option isn’t useful for OTP > 21, see I’m using OTP 23 for production. After OTP 21, the crash reports are issued as error level log events, and are logged through the default handler started by Kernel, which means they’ll be logged as error.