[5.0] Log exceptions and their messages when a job fails.

Recreated this pull request for 5.0 instead of 4.2.

Fixes issue #6203.
These might looks better aligned, and with a trailing comma, but it's not really a laravel style requirement.