mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Update OrchardLog4netLogger.cs
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user