I've recently created a logging solution for my application whereby my web servers send all request/response data to a log over HTTP to a logging server. I've done this using delegating handlers
http://www.asp.net/web-api/overview/advanced/http-message-handlers
This is working very well, but I was curious about whether or not there is a way to do this in a manner that doesn't require me to log the message before it's sent back to the client. Logging the message isn't something that adds any value for the end user, and so I'd like them to not have to wait for the logging logic to finish, before getting back their data.
I guess what I'm looking for is some kind of hook that gets called AFTER the message has already been returned to the client, but before the thread disappears, and where I can still have access to the request and response.
Am I asking for too much?
Thanks!