Logging errors for papertrail