Error logging with ELMAH does not work in WCF service hosted in IIS with basicHttpBinding

I followed the steps mentioned in this article http://dotnetslackers.com/articles/aspnet/Getting-ELMAH-to-work-with-WCF-services.aspx to configure the WCF service to configure error logging using ELMAH. it works with wsHttpBinding with a Visual studio web server, but when I host it in IIS (5/6) and change the binding to basicHttpBinding, it does not log errors. I tried to change the error signaling code to " Elmah.ErrorLog.GetDefault(null).Log(new Error(ex)); " as indicated in this link ELMAH is an exception log without HttpContext , but that didn't help either. I don’t know what else I need to do. Please help. here is the configuration for the WCF service (I tried to comment and uncomment the aspnet compatibility but it didn’t work). if there is a working sample with basicHttpBinding, that would be very helpful. thanks in advance.

  <system.serviceModel> <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />--> <bindings> <basicHttpBinding> <binding name="BasicHttpEndpointBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" /> </security> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="ElmahWCF.Service1Behavior" name="ElmahWCF.Service1"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" name="BasicHttpEndpoint" contract="ElmahWCF.IService1"> </endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ElmahWCF.Service1Behavior"> <!--To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment--> <serviceMetadata httpGetEnabled="true"/> <!--To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information--> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> 
+1
exception-handling error-handling wcf elmah
Dec 17 '10 at 12:17
source share
1 answer

I realized that he sends letters, but does not register errors in the database. this may be a problem with the release of the database (although I have full access to the database for my Windows login ID and it logs fine when placed on the visual studio web server and uses wsHttpBinding). I deployed it to the server and configured it with a different account in the application pool, after which it successfully logs errors in the database without making any changes to the code from this article. I'm still not sure why it does not log errors in the database from local IIS (I even tried to set the impersonation to true in web.config so that it uses my identifier when registering), but this is not a big problem for me, since it works great after deployment. thank.

+2
Dec 17 '10 at 17:12
source



All Articles