You might want to look at creating a LogActionFilter : ActionFilterAttribute to handle your logging. Filters give you access to the Properties dictionary and therefore you could populate the log4net properties as needed.
It is my understanding that the HttpRequestMessage only has an affinity to the request and not the underlying the thread. The request would contain the same dictionary over mutlitple threads.
davebettin
Member
313 Points
94 Posts
Re: Safe to call HttpContext from Delegating Handler?
Feb 28, 2012 07:25 PM|LINK
You might want to look at creating a LogActionFilter : ActionFilterAttribute to handle your logging. Filters give you access to the Properties dictionary and therefore you could populate the log4net properties as needed.
It is my understanding that the HttpRequestMessage only has an affinity to the request and not the underlying the thread. The request would contain the same dictionary over mutlitple threads.
Cheers,
Dave
@dbettin