mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fix intermitent bug with injecting ILogger
--HG-- branch : dev
This commit is contained in:
parent
ee31489a17
commit
c4fb128c72
@ -9,7 +9,7 @@ namespace Orchard.Logging {
|
||||
Fatal
|
||||
}
|
||||
|
||||
public interface ILogger : ISingletonDependency {
|
||||
public interface ILogger {
|
||||
bool IsEnabled(LogLevel level);
|
||||
void Log(LogLevel level, Exception exception, string format, params object[] args);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@ -14,7 +15,7 @@ namespace Orchard.Logging {
|
||||
private readonly IDictionary<string, ILogger> _loggerCache;
|
||||
|
||||
public LoggingModule() {
|
||||
_loggerCache = new Dictionary<string, ILogger>();
|
||||
_loggerCache = new ConcurrentDictionary<string, ILogger>();
|
||||
}
|
||||
|
||||
protected override void Load(ContainerBuilder moduleBuilder) {
|
||||
@ -78,7 +79,7 @@ namespace Orchard.Logging {
|
||||
else {
|
||||
var propertyValue = ctx.Resolve<ILogger>(new TypedParameter(typeof(Type), componentType));
|
||||
_loggerCache.Add(component, propertyValue);
|
||||
propertyInfo.SetValue(instance, propertyValue, null);
|
||||
propertyInfo.SetValue(instance, propertyValue, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user