Unified logging for errored responses