Example #1
0
        public static async Task LogProtocolHttpRequestAsync(SerializableHttpRequestMessage request)
        {
            var sb = new StringBuilder();

            try
            {
                string logString = await request.GetLogStringAsync().ConfigureAwait(false);

                Logger.Instance.Information(logString);
            }
            catch (Exception ex)
            {
                Logger.Instance.Warning("Log http request failed.  Ex: " + ex.ToString());
            }
        }
Example #2
0
        public static async Task LogProtocolHttpRequestAsync(HttpRequestMessage request, string requestId, bool isIncomingRequest)
        {
            var sb = new StringBuilder();

            try
            {
                var myRequest = new SerializableHttpRequestMessage();
                await myRequest.InitializeAsync(request, requestId, isIncomingRequest).ConfigureAwait(false);

                string logString = await myRequest.GetLogStringAsync().ConfigureAwait(false);

                Logger.Instance.Information(logString);
            }
            catch (Exception ex)
            {
                Logger.Instance.Warning("Log http request failed.  Ex: " + ex.ToString());
            }
        }