views:

354

answers:

0

I'm using WCF Exception Shielding to map various exceptions to FaultContracts so I can limit what information I expose to the client. I had hoped to leverage the {Guid} mapping property so I could correlate client logs and server logs:

<mappings>
  <add source="{Guid}" name="Id" />
  <add source="{Message}" name="MessageText" />
</mappings>

My service-side Exception Handling Application Block logs the exceptions, along with their GUID:

...
HandlingInstanceID: 262f5c59-2c89-4a00-b657-59dd4b04c406
...

This is working and I can see this information in the client's FaultException detail in the debugger. However, I can't figure out how to get the Exception Handling Application Block in the client to log that detail. I'm using the standard LoggingExceptionHandler with the TextExceptionFormatter:

<add name="Logging Handler"
  ...
  type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler...
  formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter... />

But this does not seem to include any of the custom detail.

Short of explicitly logging the exception myself (defeating part of the value of EHAB), how can I record the GUID in my client logs?