Exception Handling and Logging

Topics: Exception Handling Application Block, Logging Application Block
Dec 29, 2009 at 4:42 PM


I am trying to shield  exception for a WCF service. My server has Windows Server 2008 and web server is IIS7. Everything works fine, that is using enterprise library I am able to convert the exception to a FaultContract and my client receives a FaultContract when there is an exception on the server. However there is one hiccup before converting the Exception to FaultContract on the server I want to log the exception in either EventLog->Application log or to a trace file. I have created the Logging Handler to log the exception to Eventlog->Application and trace file however there is no exception logged niether the trace file created on the server.

I know this is something to go with permissions because I am able to log exception and create trace file when I host my service on local machine (using IIS7). The application pool for the WCF service on the server has NetworkService account as its identity, Can somebody tell me what I need to do in order to log exceptions correctly on the server. So far I have tried to grant read and write permissions to NetworkService account on the EventLog as well as to the folder where the trace file is saved but this does not seem to work.

Thank you,


Jan 4, 2010 at 7:24 AM


Try giving a "Full Control" permission to the NetworkService for now. We'll be investigating this further and provide you updates incase the problem still persists.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.