3

I was searching on how the logged in user name was set using ELmah.

The closer i came is the below link

Logging username with Elmah for WCF Webservices

Elmah take the user from Thread.CurrentPrincipal.Identity.Name and not from HttpContext.Current.User

To get more clarity on this does the thread takes Nnme from the windows log on" ?

Or will it log the name if i set HttpContext.Current.User ?

How does it work. How application architecture should be to make ELMAH feasible to log UserName ?

Thanks

Community
  • 1
  • 1
Peru
  • 2,871
  • 5
  • 37
  • 66
  • Scott Hanselman has a [great post](http://www.hanselman.com/blog/SystemThreadingThreadCurrentPrincipalVsSystemWebHttpContextCurrentUserOrWhyFormsAuthenticationCanBeSubtle.aspx) on the differences of these two. there is also [another SO question](http://stackoverflow.com/questions/1843271/whats-the-difference-between-httpcontext-current-user-and-thread-currentprincip) derived from these two identity types. – Brad Christie Aug 22 '13 at 13:18
  • @BradChristie Thanks for those Excellent links! So i assume ELMAH uses the Thread identity ? – Peru Aug 22 '13 at 14:40

0 Answers0