My company's standard logging tool is NLog. I'm trying to introduce Quartz.net and was asked if it could use NLog instead of Log4Net.
I know I can recompile to use NLog, but I'd like to do it from the configuration files if at all possible.
My company's standard logging tool is NLog. I'm trying to introduce Quartz.net and was asked if it could use NLog instead of Log4Net.
I know I can recompile to use NLog, but I'd like to do it from the configuration files if at all possible.
Assuming that you're using Quartz.net 1.0.3. you have to add a reference to the following assemblies:
Common.Logging
Common.Logging.NLog
NLog
Then you have to add the following configuration in your application's config file:
Note that I am using an external NLog.config file.
NOTE:
Quartz.net uses Common.Logging version 1.2.
Today I'm facing with the same issue. This article help me a lot, but thigs are changed a little bit...
I use Quartz.Net 2.6.1.
Common.Logging.NLog is deprecated and there is a new dll for each NLog version.
So the new configs is:
The namespace of NLogLoggerFactoryAdapter is not changed, but the dll name is changed.
Be sure you have the same version of:
Common.Logging
Common.Logging.Core
Common.Logging.NLogXX
The use of config directives is certainly one way of doing this, but if you have an existing nlog config and want to just 'drop in' the quartz logging, it's unnecessary.
Simply reference 'Common.Logging.NLog' of the appropriate version from nuget, configure your logging as normal and add this to the end:
All of the quartz logging (and all common logging) will now be forwarded to your existing nlog configuration.