Quartz.net and Common.Logging - Using Log4Net

I am using Quartz.net in a windows service. Currently the trigger does not work - I would like to use the log to find out why.

I edited my configuration file for the Windows service:

<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    </sectionGroup>
</configSections>

<appSettings>
    <!--specific win service settings here-->
</appSettings>

<common>
    <logging>
        <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
            <arg key="configType" value="INLINE"/>
            <arg key="configFile" value="c:\sched.log"/>
            <arg key="level" value="INFO" />
        </factoryAdapter>
    </logging>
</common>

<log4net>
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%d [%t] %-5p %l - %m%n" />
      </layout>
    </appender>
    <root>
      <level value="INFO" />
      <appender-ref ref="EventLogAppender" />
    </root>
</log4net>

My file structure is as follows:

C: \ CompanyName - the root directory for all projects
C: \ CompanyName \ build \ bin - the output directory for all projects / class libraries in my solution
C: \ CompanyName \ lib - where third-party / dll files are located

In my windows service project, I have a link to Quartz (in the folder C: \ CompanyName \ lib)

I also added a link to Common.Logging.Log4net.dll

When I test my application, I get the following error:

'Common.Logging, Version = 2.0.0.0, Culture = , PublicKeyToken = af08829b84f0328e ' . . ( HRESULT: 0x80131040) ":" Common.Logging, = 2.0.0.0, = , PublicKeyToken = af08829b84f0328e

+3
2

, Common.Logging. Quartz.Net Common.Logging 1.2, 2.0. 2.0, quartz.net 2.0- , .

+6

, , , .

0

Source: https://habr.com/ru/post/1732177/


All Articles