I'm trying to find a way to log the regex that was used to the match a route from MVC3 (i.e. /api/person/{personid}/address/{addressid})
I've found that you can use HttpResponse.AppendToLog in order to append something onto the cs-uri-query in the IIS logs, but this is pretty hacky and makes processing the logs a pita.This has led me to HttpModules and IIS7 Advanced logging.
My current understanding is that I can make fields available to Advanced Logging from an HttpModule. So I should be able to look up the regex used by the Route object in the HttpContext and expose that as a field that Advanced Logging can consume and log.
My issue is that I'm having issues figuring out exactly how to expose data as a field in a custom HttpModule that Advanced Logging can consume.
Do I need to have an event handler for LogRequest? If I do that what am I supposed to do in the event handler to make it consumable for Advanced Logging?
Any pointers, code samples and/or links to documentation would be greatly appreciated.
As an aside if you know of any documentation explaining/listing the available 'published' fields from default modules installed in IIS7 I'd appreciate a link.