Merge pull request #1235 from MediaBrowser/master

trim response logging
This commit is contained in:
Luke 2015-10-28 15:17:20 -04:00
commit 813c715489

View File

@ -1,7 +1,6 @@
using MediaBrowser.Model.Logging;
using System;
using System.Globalization;
using System.Text;
namespace MediaBrowser.Server.Implementations.HttpServer
{
@ -17,17 +16,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <param name="duration">The duration.</param>
public static void LogResponse(ILogger logger, int statusCode, string url, string endPoint, TimeSpan duration)
{
var log = new StringBuilder();
log.AppendLine(string.Format("Url: {0}", url));
//log.AppendLine("Headers: " + string.Join(",", response.Headers.AllKeys.Select(k => k + "=" + response.Headers[k])));
var responseTime = string.Format(". Response time: {0} ms.", duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
var msg = "HTTP Response " + statusCode + " to " + endPoint + responseTime;
logger.LogMultiline(msg, LogSeverity.Info, log);
logger.Info("HTTP Response {0} to {1}. Time: {2}ms. {3}", statusCode, endPoint, Convert.ToInt32(duration.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), url);
}
}
}