I've been studying the W3C format log files in IIS 7.5 for a while on a server with some performance issues, and it seems to me that, contrary to MSDN documentation, the "time" field is not
"the time, in Coordinated Universal Time (UTC), at which the request occurred"
... but rather it is the time at which the response was finished being sent.
I say this because when I track the sequence of page request from users in a somewhat controlled environment, they would have to be going back in time to submit the next request, or else they are able to submit their requests for pages shockingly fast for a page with a large time-taken entry.
For example (and I am redacting, abbreviating, and omitting, for security and clarity):
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip sc-status sc-substatus sc-win32-status time-taken 2012-11-28 22:25:17 192.168.0.21 GET /Main.aspx - 80 AWalker 192.168.0.100 200 0 0 764 2012-11-28 22:25:26 192.168.0.21 POST /Main.aspx - 80 AWalker 192.168.0.100 200 0 0 109 2012-11-28 22:25:56 192.168.0.21 GET /_Start.aspx - 80 AWalker 192.168.0.100 302 0 0 28782 2012-11-28 22:26:33 192.168.0.21 GET /Action.aspx - 80 AWalker 192.168.0.100 200 0 0 38032 2012-11-28 22:26:46 192.168.0.21 POST /Action.aspx - 80 AWalker 192.168.0.100 200 0 0 124 2012-11-28 22:27:39 192.168.0.21 GET /Information.aspx - 80 AWalker 192.168.0.100 200 0 0 52509 2012-11-28 22:27:52 192.168.0.21 POST /Information.aspx - 80 AWalker 192.168.0.100 200 0 0 140
If I interpret "time" as "request received" (either beginning or end, but before the response begins), then this looks wrong. Here's what I mean:
This kind of pattern keeps going, over and over, in the logs.
Conversely, if I were to interpret the "time" field to mean "response finished", then I get saner numbers:
The other reason that it just makes more sense to me that the "time" field represents the end of the response, rather than the beginning of the request is this:
The log entries are recorded physically in ascending order of the "time" field (chronologically ordered), but they always include the "time-taken" field, which could only be known after the response had been finally delivered.
So which way is it? Is the documentation wrong?
Time-taken field By default, IIS logs HTTP site activity by using the W3C Extended log file format. You can use IIS Manager to select the fields to include in the log file. One of these fields is the time-taken field. The time-taken field measures the length of time that it takes for a request to be processed.
The default time for IIS logs is in UTC. On the IIS Manager main page, you can click 'Logging' and it gives you the option to save logs in your local time format (whatever that may be).
On this page: http://blogs.msdn.com/b/mike/archive/2008/11/13/time-vs-time-taken-fields-in-iis-logging.aspx
it says:
The Time field is quite straightforward: it specifies when the log entry was created. Note that this is not always the same as when the log entry actually gets written to the log, as buffering can occur for some request/response scenarios.
Therefore, you are correct in thinking that the time most closely corresponds to the time that the request finished. That same page goes on to clarify:
If you wanted to calculate the approximate Start Time of a request, you would subtract the Time-Taken value from the Time value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With