I'm using IErrorHandler to do exception handling in WCF and now I want to log the exceptions, along with the stack trace and the user that caused the exception.
The only way I can see to get the user that caused the exception is:
OperationContext.Current.IncomingMessageProperties.Security.ServiceSecurityContext.PrimaryIdentity
...But this only seems to work inside ProvideFault, and not inside HandleError. Is there a way to get the user inside HandleError? I would like to use HandleError instead of ProvideFault as that's called on a background thread and meant for error logging, right?