Update OrchardLog4netLogger.cs

This commit is contained in:
jtkech
2015-10-01 21:22:21 +02:00
parent 508d97ed7d
commit 850a39bd8b

View File

@@ -63,12 +63,18 @@ namespace Orchard.Logging {
if (_shellSettings.Value != null) {
ThreadContext.Properties["Tenant"] = _shellSettings.Value.Name;
}
else {
ThreadContext.Properties.Remove("Tenant");
}
try {
var ctx = HttpContext.Current;
if (ctx != null) {
ThreadContext.Properties["Url"] = ctx.Request.Url.ToString();
}
else {
ThreadContext.Properties.Remove("Url");
}
}
catch(HttpException) {
// can happen on cloud service for an unknown reason
@@ -416,4 +422,4 @@ namespace Orchard.Logging {
}
}
}
}