Include exception in logged error messages

To improve the user's ability to understand what the problem is, include the exception when logging error messages.