using log4net with quartz

625 views
Skip to first unread message

Sean Farrow

unread,
Jan 28, 2013, 10:40:17 PM1/28/13
to quar...@googlegroups.com

Hi Fokes:

Is it possible to use Log4Net with quartz 2.1.2?

If yes how do I go about doing this?

Chers

San.

Sean.

Christian

unread,
Feb 12, 2013, 6:03:39 AM2/12/13
to quar...@googlegroups.com
Hi Sean

Quartz.Net uses the Common.Logging API.
You can use log4net by spectifying the following in your app.config.
You also need the log4net.dll and Common.Logging.Log4Net1211.dll to be referenced in your project.
The logging configuration is then read from log4net.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a" />
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    </sectionGroup>   
  </configSections>
  <common>
    <logging>
      <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4net1211">
        <arg key="configType" value="INLINE" />
      </factoryAdapter>
    </logging>
  </common>
  <log4net configSource="log4net.config" />

Regards
Christian

Jo

unread,
Apr 16, 2013, 2:58:47 PM4/16/13
to quar...@googlegroups.com
I have an assembly Foo in my Windows service that references version 1.2.10.0 of log4net. Quartz works with version 1.2.11.0.

One solution I found was to use a 1.2.11.0 assembly with the old public key token and then use assembling rebinding in app.config to get Foo to use the newer version also used by Quartz.

Unfortunately, there seems to be a method signature change between versions so this won't work:

http://netpl.blogspot.com/2012/03/pathetic-breaking-change-between.html

The other possible solution looks promising:

http://stackoverflow.com/questions/3158928/referencing-2-differents-versions-of-log4net-in-the-same-solution

Before I start implementing this, has anyone encountered this issue and how did you resolve it? Thx.
Reply all
Reply to author
Forward
0 new messages