Emit a log for any error performing a query.