one more logging fix
This commit is contained in:
parent
ecb89c3d1d
commit
a6596042a6
|
@ -386,6 +386,7 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||||
var httpRes = new HttpListenerResponseWrapper(context.Response);
|
var httpRes = new HttpListenerResponseWrapper(context.Response);
|
||||||
var handler = ServiceStackHttpHandlerFactory.GetHandler(httpReq);
|
var handler = ServiceStackHttpHandlerFactory.GetHandler(httpReq);
|
||||||
|
|
||||||
|
var url = context.Request.Url.ToString();
|
||||||
var endPoint = context.Request.RemoteEndPoint;
|
var endPoint = context.Request.RemoteEndPoint;
|
||||||
|
|
||||||
var serviceStackHandler = handler as IServiceStackHttpHandler;
|
var serviceStackHandler = handler as IServiceStackHttpHandler;
|
||||||
|
@ -398,7 +399,7 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||||
httpReq.OperationName = operationName = restHandler.RestPath.RequestType.Name;
|
httpReq.OperationName = operationName = restHandler.RestPath.RequestType.Name;
|
||||||
}
|
}
|
||||||
serviceStackHandler.ProcessRequest(httpReq, httpRes, operationName);
|
serviceStackHandler.ProcessRequest(httpReq, httpRes, operationName);
|
||||||
LogResponse(context, endPoint);
|
LogResponse(context, url, endPoint);
|
||||||
httpRes.Close();
|
httpRes.Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -410,7 +411,7 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||||
/// Logs the response.
|
/// Logs the response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ctx">The CTX.</param>
|
/// <param name="ctx">The CTX.</param>
|
||||||
private void LogResponse(HttpListenerContext ctx, IPEndPoint endPoint)
|
private void LogResponse(HttpListenerContext ctx, string url, IPEndPoint endPoint)
|
||||||
{
|
{
|
||||||
if (!EnableHttpRequestLogging)
|
if (!EnableHttpRequestLogging)
|
||||||
{
|
{
|
||||||
|
@ -421,7 +422,7 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||||
|
|
||||||
var log = new StringBuilder();
|
var log = new StringBuilder();
|
||||||
|
|
||||||
log.AppendLine(string.Format("Url: {0}", ctx.Request.Url));
|
log.AppendLine(string.Format("Url: {0}", url));
|
||||||
|
|
||||||
log.AppendLine("Headers: " + string.Join(",", ctx.Response.Headers.AllKeys.Select(k => k + "=" + ctx.Response.Headers[k])));
|
log.AppendLine("Headers: " + string.Join(",", ctx.Response.Headers.AllKeys.Select(k => k + "=" + ctx.Response.Headers[k])));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user