/// <summary> /// Gets the formatted logs for an HTTP request. /// </summary> /// <param name="requestInfo">The request information.</param> /// <param name="headersToMask">The headers to mask.</param> /// <param name="traceFormatter">The trace formatter to use when formatting /// the message.</param> /// <returns></returns> private string GetFormattedRequestLog(RequestInfo requestInfo, ISet<string> headersToMask, TraceFormatter traceFormatter) { StringBuilder builder = new StringBuilder(); builder.AppendFormat("\r\n-----------------BEGIN API CALL---------------------\r\n"); builder.AppendFormat("\r\nRequest\r\n"); builder.AppendFormat("-------\r\n\r\n"); StringBuilder headerBuilder = new StringBuilder(); headerBuilder.AppendFormat("{0} {1}\r\n", requestInfo.Method, requestInfo.Uri.AbsolutePath); headerBuilder.AppendFormat("{0}", GetFormattedHttpHeaderLogs(MaskHeaders( requestInfo.Headers, headersToMask), "\r\n")); builder.AppendFormat("{0}\r\n\r\n{1}\r\n", headerBuilder.ToString(), traceFormatter.MaskContents(requestInfo.Body, headersToMask)); return builder.ToString(); }
/// <summary> /// Handles the SOAP message. /// </summary> /// <param name="requestInfo">Request info.</param> /// <param name="responseInfo">Response info.</param> public virtual void HandleMessage(RequestInfo requestInfo, ResponseInfo responseInfo) { PerformLogging(requestInfo, responseInfo); }