Ensure logger middleware also prints stack traces.

When an error occurs and the default error handler is being used.