Updated logFailedRequest method