Mobile app version of vmapp.org
Login or Join
Murray432

: When does Apache log to access.log - before or after serving the request? Reading this post "Understanding Apache Access Log" it refers to http://httpd.apache.org/docs/1.3/logs.html which says

@Murray432

Posted in: #Apache2 #ApacheLogFiles

Reading this post "Understanding Apache Access Log" it refers to 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 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...)

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme