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) { if (_shellSettings.Value != null) {
ThreadContext.Properties["Tenant"] = _shellSettings.Value.Name; ThreadContext.Properties["Tenant"] = _shellSettings.Value.Name;
} }
else {
ThreadContext.Properties.Remove("Tenant");
}
try { try {
var ctx = HttpContext.Current; var ctx = HttpContext.Current;
if (ctx != null) { if (ctx != null) {
ThreadContext.Properties["Url"] = ctx.Request.Url.ToString(); ThreadContext.Properties["Url"] = ctx.Request.Url.ToString();
} }
else {
ThreadContext.Properties.Remove("Url");
}
} }
catch(HttpException) { catch(HttpException) {
// can happen on cloud service for an unknown reason // can happen on cloud service for an unknown reason