Added error logging to HttpClient (so headers do not get lost if trace is not enabled)