How to use ProviderIsAvailableOverride property in log providers #954
-
We have an application that uses CSLA3, and we're trying to upgrade our Quartz to 3.1.0 so we can get the fix to #794. We're getting a StackOverflowException in the Impl.DirectSchedulerFactory constructor using 3.1. The stack overflow is from mixing CSLA3's custom assembly resolve event handler with how the log provider is initialized. We were on 2.6.1, so we've been using NLog as our provider. The issue is that the log provider initialization tries to find the Serilog assembly first, and the custom assembly resolve handler is repeatedly recursively trying to load it. Setting ProviderIsAvailableOverride to false for SerilogLogProvider would be sufficient to resolve this issue, but the class itself is internal. Is there some other way to set this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think you can work around this by calling |
Beta Was this translation helpful? Give feedback.
I think you can work around this by calling
Quartz.Logging.LogProvider.SetCurrentLogProvider(ILogProvider)
. You you supply theNLogLogProvider
(or your own wrapper) taken from sources it should skip trying to scan for the logger implementation as one is already set. If you are on .NET Core boat with MS logging abstractions and already have the NLog bridge there, there's alsoQuartz.LogContext.SetCurrentLogProvider(ILoggerFactory)
.