Permalink
Browse files

Only register the ILogger if there isn't one already supplied.

  • Loading branch information...
1 parent 82a3b54 commit a8eeb745de666251538575df06dd59ee1a613263 Graham Hay committed Dec 6, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core/OpenRasta/Configuration/DefaultDependencyRegistrar.cs
@@ -363,9 +363,13 @@ protected virtual void RegisterDefaultTraceListener(IDependencyResolver resolver
protected virtual void RegisterLogging(IDependencyResolver resolver)
{
- resolver.AddDependency(typeof(ILogger), LoggerType, DependencyLifetime.Singleton);
+ var loggerInterfaceType = typeof(ILogger);
+ if (resolver.HasDependency(loggerInterfaceType) == false)
+ {
+ resolver.AddDependency(loggerInterfaceType, LoggerType, DependencyLifetime.Singleton);
+ }
- RegisterTraceSourceListeners(resolver);
+ RegisterTraceSourceListeners(resolver);
RegisterDefaultTraceListener(resolver);
}

0 comments on commit a8eeb74

Please sign in to comment.