How to log exception + stacktrace

You are in the right path with Exception.format_banner/3, but this function does not print the stacktrace. Instead, use Exception.format/3, and you will be good to go.

Now about the kind parameter, is basically one of this 3 options: :error, :throw or :exit. For exceptions catched with try do ... rescue, use the :error kind.

For more detail about it, look at the try, catch and rescue guide.