问题原文
原帖链接 · rhellem · CC BY-SA 4.0
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...)
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 3.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
