开发者

Common.Logging for custom built log4net

How can i configure the Common.Logging->log4net which log4net built with a different .snk file? when i want to build the Project it looks for log4net that has a PublicKeyToken=1开发者_如何学Pythonb44e1d426115821, but mine is different. I tried to identify my log4net assembly as below. that doesn't work.

<configSections>
<sectionGroup name="common">
  <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net,Version=1.2.10.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXX"/>

thanks


Have you made Common.Logging reference your version of log4net and then rebuilt it (Common.Logging)?

I suspect that you will have to open the Common.Logging.Log4Net project and change the reference to log4net from the log4net that Common.Logging redistributes to your log4net. I think that you should then be able to rebuild Common.Logging and you should also be able to reference your version of log4net in the configuration.

UPDATE... Another idea would be to write your own log4net factory adapter. Just use the exact source code from Commom.Logging's log4net factory adapter project. There is not really much code there. In your project, reference your own log4net. Configure Common.Logging to use your factory adapter. I don't know that this option is any more or less attractive than rebuilding Commom.Logging with your version of log4net, but I thought I would mention it anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜