# Log timeouts to access log

**URL:** <https://www.ruby-forum.com/t/log-timeouts-to-access-log/236925>\
**Category:** NGINX\
**Created:** [October 11, 2013, 1:11pm UTC](https://www.ruby-forum.com/t/log-timeouts-to-access-log/236925 "2013-10-11T13:11:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [October 11, 2013, 1:11pm UTC](https://www.ruby-forum.com/t/log-timeouts-to-access-log/236925/1 "2013-10-11T13:11:37Z")

</div>

Hi  
I would like to log an indication of weather a request ended because of  
a client timeout - in the access.log

e.g.

log\_format normal '$remote\_addr - $remote\_user [$time\_local] ’  
'"$request" $status $bytes\_sent ’ ‘"$http\_referer" “$http\_user\_agent”  
“$client\_send\_timed\_out”’;  
where $client\_send\_timed\_out would be a true/false or an 0/1 etc

Is there anything in there that would allow me to log that?

Many thanks  
Richard

---

<div class="post-metadata">

**Author:** ![rkoskela](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce73a5/32.png) [@rkoskela](https://www.ruby-forum.com/u/rkoskela)\
**Post date:** [October 11, 2013, 1:25pm UTC](https://www.ruby-forum.com/t/log-timeouts-to-access-log/236925/2 "2013-10-11T13:25:40Z")

</div>

Hello!

On Fri, Oct 11, 2013 at 12:11:10PM +0100, Richard K. wrote:

> Is there anything in there that would allow me to log that?

Closest to what you ask about I can think of is the  
$request\_completion variable. Though it marks not only timeouts  
but whether a request was completely served or not.

[http://nginx.org/en/docs/http/ngx\_http\_core\_module.html#var\_request\_completion](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_completion)

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![rkoskela](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce73a5/32.png) [@rkoskela](https://www.ruby-forum.com/u/rkoskela)\
**Post date:** [October 11, 2013, 7:07pm UTC](https://www.ruby-forum.com/t/log-timeouts-to-access-log/236925/3 "2013-10-11T19:07:35Z")

</div>

On 11/10/13 12:25, Maxim D. wrote:

> Closest to what you ask about I can think of is the  
> $request\_completion variable. Though it marks not only timeouts but  
> whether a request was completely served or not.  
> [Module ngx\_http\_core\_module](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_completion)

thanks that might be what I need (as long as I ignore mp4/flv seeking  
requests)

Cheers  
Richard
