5

Reading this post "Understanding Apache Access Log" it refers to http://httpd.apache.org/docs/1.3/logs.html which says

%t is the time the server finished processing the request.

By this I understand that a line in access.log will not be written until the request has been served by the server. So if the request takes one minute, the timestamp will be one minute after the server received the request.

But, the above doc is for Apache 1.3. Reading this one http://httpd.apache.org/docs/2.2/mod/mod_log_config.html it says

%t Time the request was received (standard english format)

Now understanding that based on the above example, the timestamp is referring to when the request was first received by the server. But if so, then Apache would need to update access.log yet another time when the request has been served. Or maybe wait to update access.log until the request has been finished, but I doubt that since I would expect the events not to be sorted by time - but they are (making the first explanation more reasonable according to my understanding.

So which one is correct, finished processing or received - or both depending on version? (Or, what have I not fully understood...)

  • 2
    These are two very different versions of Apache. Much has changed during the time between versions. Read the documentation for the version you are running and do not over-think things between versions that were years apart. If you are running 2.2, do not add into your lexicon anything written in the version 1.3 documentation. – closetnoc Jul 1 '14 at 20:31
6

Apache writes to the log file after the request has been completed. It is able to remember the time that the request was started and write this time into the log file after the request was finished.

This means that Apache log files are not going to be strictly ordered. There may be earlier records that get recorded late because the requests takes a long time.

Apache never goes back and revises log entries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.