2010-12-17 3 views
1

이 문서에서 언급 한 단계 http://dotnetslackers.com/articles/aspnet/Getting-ELMAH-to-work-with-WCF-services.aspx을 따라 ELMAH에서 오류 로깅을 설정하도록 WCF 서비스를 구성했습니다. 그것은 Visual Studio 웹 서버와 wsHttpBinding 함께 작동하지만 IIS (5/6)에서 호스팅하고 basicHttpBinding 바인딩을 변경하면 오류를 기록하지 않습니다. 나는 "Elmah.ErrorLog.GetDefault(null).Log(new Error(ex));"이라는 오류 신호 코드를이 링크 ELMAH - Exception Logging without having HttpContext에서 언급했듯이 변경하려고했지만 그 역시 도움이되지 못했습니다. 내가 뭘해야하는지 잘 모르겠다. 도와주세요. 여기에 WCF 서비스에 대한 구성이 있습니다 (주석을 달고 aspnetcompatibility도 주석 처리했지만 작동하지 않았습니다). basicHttpBinding이있는 작동하는 샘플이 있으면 매우 유용 할 것입니다. 미리 감사드립니다.basicHttpBinding을 사용하여 IIS에서 호스팅되는 WCF 서비스에서 ELMAH가 작동하지 않음으로 인한 오류 로깅

<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> 

답변

2

나는 메일을 보내고 있지만 데이터베이스에 오류를 기록하지 않는다는 것을 알아 냈습니다. 데이터베이스 사용 권한 문제가 될 수 있습니다 (비록 내 Windows 로그인 ID에 대한 데이터베이스에 대한 전체 액세스 권한이 있고 Visual Studio 웹 서버에서 호스팅되고 wsHttpBinding이 사용되는 경우에도 잘 기록됩니다). 서버에 배포하고 응용 프로그램 풀에서 다른 계정으로 구성한 후에는 기사의 코드를 변경하지 않고도 오류를 데이터베이스에 성공적으로 기록합니다. 나는 여전히 로컬 IIS에서 데이터베이스에 오류를 기록하지 않는 이유를 확신하지 못한다. (심지어 로깅 할 때 내 ID를 사용하도록 web.config에서 가장을 설정하려고 시도해 보았다.)하지만 큰 문제는 아니었다. 배포 후 잘 작동합니다. 감사.

관련 문제