Does anyone know how I could get IIS to log POST data or the entire HTTP request?
The IIS logs only record querystring and header information without any POST data.
If you're using IIS7, you can enabled Failed Request Tracing for status code 200. That will record all of the data and you can select which type of data to include.
In either IIS6 or 7, you can use Application_BeginRequest in global.asax and create your own logging of POST data.
Or, in IIS7, you can write a HTTP Module with your own custom logging.
In managed code you can use the Response.AppendToLog method. This method will append data to the cs-uri-stem field -- the total length is up to 4100 characters (undocumented). If you exceed that limit, then the value that would have been logged is replaced with "..."
For instance, adding something like this to your Global.asax file should do the trick (C#):
While I appreciate that this is an old question, I found this code gave me exactly what I needed, a text file with the complete request headers and the response, put it into your global.asax.cs:
This will create a text file for each and every request (including images) so be careful where you use it. I only used it to log specific post requests.
Try enabling the following in your IIS log settings:
URI Stem (cs-uri-stem)
URI Query (cs-uri-query)
protected by HopelessN00b Feb 18 '15 at 11:54
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?