开发者

unable to get log4net to use WebServiceAppender from crm 2011

开发者 https://www.devze.com 2023-04-09 06:29 出处:网络
I have attempted to use a log4net webserviceappender from within a crm 2011 plug开发者_如何学编程in (sandboxed), log4net apparently gets installed along with the plugin correctly (exception if log4net

I have attempted to use a log4net webserviceappender from within a crm 2011 plug开发者_如何学编程in (sandboxed), log4net apparently gets installed along with the plugin correctly (exception if log4net config file is malformed), but apparently the appender doesn't get called. I can call the webservice directly from within the plugin, so that part is working, but can't figure out what might be wrong with log4net.

Does anyone know of a step by step for using log4net with crm and/or have a good idea as to why the webserviceappender doesn't get called?

Thanks

EDIT: Including log4net.config file upon request.

  <!-- WebService parameters. -->
  <param name="Url" value="http://my-internal-server/errorlog/ErrorHandler.asmx" />
  <param name="TimeoutSeconds" value="60" />

  <!-- Proxy parameters. -->
  <param name="UseProxy" value="false" />
  <param name="ProxyUrl" value="http://myproxy:3128" />
  <param name="ProxyBypassOnLocal" value="true" />
  <param name="ProxyUseDefaultCredentials" value="true" />
  <param name="ProxyCredentialsDomain" value="OFFICE" />
  <param name="ProxyCredentialsUserName" value="MyUser" />
  <param name="ProxyCredentialsPassword" value="MyPassword" />
</appender>

<root>
  <level value="Info" />
  <appender-ref ref="WebServiceAppender" />
</root>


It looks like you have deployed the configuration file on disk. This is not the ideal place as you have to deal with different requirements for the different modules.

To simplify the deployment of plugins, which need additional configuration, you have the possibility to pass configuration values to the plugin constructor. You should pass the configuration and configure log4net at runtime. See how to write the plugin constructor.

Another option is to use the webressources of Dynamics CRM 2011. See this blog article which describes all available options.

0

精彩评论

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