Bra*_*uce 6 log4net nlog quartz.net common.logging
我公司的标准日志工具是NLog.我正在尝试介绍Quartz.net,并询问它是否可以使用NLog而不是Log4Net.
我知道我可以重新编译使用NLog,但是如果可能的话,我想从配置文件中做到这一点.
假设您使用的是Quartz.net 1.0.3.您必须添加对以下程序集的引用:
Common.Logging
Common.Logging.NLog
NLog
然后,您必须在应用程序的配置文件中添加以下配置:
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
...
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog">
<arg key="configType" value="FILE" />
<arg key="configFile" value="~/NLog.config" />
</factoryAdapter>
</logging>
</common>
</configuration>
Run Code Online (Sandbox Code Playgroud)
请注意,我使用的是外部NLog.config文件.
注意:
Quartz.net使用Common.Logging 1.2版.
| 归档时间: |
|
| 查看次数: |
10826 次 |
| 最近记录: |