From 360caa74aad5bee75208110867bee4a78da9d8f8 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 3 Mar 2017 09:12:59 +0100 Subject: [PATCH] - add: refine tracing --- WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs b/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs index bd30c52..8eaa6f4 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs +++ b/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs @@ -235,7 +235,7 @@ namespace WebDAVSharp.Server { Thread.SetData(Thread.GetNamedDataSlot(HttpUser), context.User.Identity); _log.Info(context.Request.HttpMethod + " " + fileName); - Trace.WriteLine($"\nWebDAV - {context.Request.HttpMethod} - {fileName} - {context.User.Identity.AuthenticationType}: {context.User.Identity.Name}"); // + Trace.WriteLine($"\nWebDAV - {context.Request.HttpMethod} - {fileName} - {context.User.Identity.AuthenticationType}: {context.User.Identity.Name}", "Info"); // try { try { string method = context.Request.HttpMethod; @@ -273,7 +273,7 @@ namespace WebDAVSharp.Server { } catch (WebDavException ex) { _log.Warn(ex.StatusCode + " " + ex.Message); - Trace.WriteLine($"WebDAV ex - {ex.StatusCode} - {ex.StatusDescription} : {ex.Message}"); // + Trace.WriteLine($"WebDAV - {ex.StatusCode} - {ex.StatusDescription} : {ex.Message}", "Warning"); // context.Response.StatusCode = ex.StatusCode; context.Response.StatusDescription = ex.StatusDescription; if (ex.Message != context.Response.StatusDescription) { @@ -293,9 +293,9 @@ namespace WebDAVSharp.Server { } } catch (Exception ex) { - Trace.WriteLine(ex); + Trace.TraceError(ex.ToString()); } - Trace.WriteLine("WebDAV - " + context.Response.StatusCode + " " + context.Response.StatusDescription + ": " + context.Request.HttpMethod + " " + fileName + "Headers:\n" + headers); + Trace.WriteLine($"WebDAV - {context.Response.StatusCode} {context.Response.StatusDescription}: {context.Request.HttpMethod} {fileName}\n{headers}", "Info"); } } }