Add a few log error messages.

In addition to returning errors to the caller, log the error with a prefix
in a few key places that helps identify the origin for errors.  In some
cases, the underlying error comes from a different subsystem such as the
SQL database driver and the error messages can be fairly generic.