Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm reading some nginx logs for some rather long-lasting requests (up to 10 seconds). In the log format, we're using the $time_local variable to record the time. But does this mean the time when the request started or when it finished? For a long-running request, these are quite distinct times, and I can't find anything in the ngx_http_log_module documentation to explain this.

share|improve this question
up vote 5 down vote accepted

The $local_time variable contains the time when the log entry is written.

when the HTTP request header is read, nginx does a lookup of the associated virtual server configuration. If the virtual server is found, the request goes through six phases:

  • server rewrite phase
  • location phase
  • location rewrite phase (which can bring the request back to the previous phase)
  • access control phase
  • try_files phase
  • log phase

Since the log phase is the last one, $local_time variable is much more colse to the end of the request than it's start.

share|improve this answer
thanks.. can you show me where I could have found this in the documentation? – Philip Potter Oct 16 '12 at 11:34
1 The information is on the link "The Architecture of Open Source Applications Volume II" which is a good reference book. – m0ntassar Oct 16 '12 at 13:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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