- add: refine tracing
This commit is contained in:
parent
5cf65703b4
commit
360caa74aa
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue