# Nginx doesn't seem to log all accesses (some uwsgi accesses are missing)

**URL:** <https://www.ruby-forum.com/t/nginx-doesnt-seem-to-log-all-accesses-some-uwsgi-accesses-are-missing/216192>\
**Category:** NGINX\
**Created:** [January 28, 2012, 6:18pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-seem-to-log-all-accesses-some-uwsgi-accesses-are-missing/216192 "2012-01-28T18:18:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 28, 2012, 6:18pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-seem-to-log-all-accesses-some-uwsgi-accesses-are-missing/216192/1 "2012-01-28T18:18:55Z")

</div>

Hi everybody,  
I hope the message does NOT show up three times.  
My news client always reports errors and I don’t know whether the  
message was sent out or not.

I’m having following setup:

nginx \<-unix\_socket-\> uwsgi -\> django

What I noticed is, that some requests of the uwsgi.log file do NOT show  
up in nginx’ access\_log file.

Example:  
in uwsgi.log I can see:  
[pid: 1205|app: 0|req: 537/1453] xx.xx.xx.33 () {40 vars in 1794 bytes}  
[Thu Jan 26 18:42:31 2012] POST /my\_url/run?var=123 =\> generated 129  
bytes in 94 msecs (HTTP/1.0 200) 3 headers in 174 bytes (1 switches on  
core 0)

However I don’t see any corresponding request logged in nginx log.

Is this the expected behaviour?  
What could be the reason?

Ideally I would like to see all accesses in nginx’ access file.

My nginx.conf  
#--------------  
worker\_processes 2;  
events {  
worker\_connections 1024;  
}  
http {  
include mime.types;  
default\_type application/octet-stream;

```
 sendfile on;
 keepalive_timeout 65;

 include sites-enabled/*;

 uwsgi_temp_path /etc/uwsgi/;

```

}

# sites\_enabled/ssl;

# ---------------------------------------

The probably relevant nginx config lines:  
upstream django {  
ip\_hash;  
server unix:/var/sock/nginx.sock;  
}

server {  
listen 443;  
server\_name myserver;  
access\_log /var/log/nginx/access.log;  
error\_log /var/log/nginx/error.log;

```
 ssl on;
 # cert info . . . .
 ssl_verify_client optional;
 ssl_session_timeout 5m;
 # cipher info

 location ^~ /static {
     root /my/static;
     index index.html index.htm;
 }

 location ^~ /registration {
     uwsgi_pass django;
     uwsgi_param UWSGI_SCHEME https;
     include uwsgi_params;
 }

```

}

---

<div class="post-metadata">

**Author:** ![Gelonida](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Gelonida](https://www.ruby-forum.com/u/Gelonida)\
**Post date:** [January 30, 2012, 12:04am UTC](https://www.ruby-forum.com/t/nginx-doesnt-seem-to-log-all-accesses-some-uwsgi-accesses-are-missing/216192/2 "2012-01-30T00:04:09Z")

</div>

Hello!

On Sat, Jan 28, 2012 at 04:38:46PM +0100, Gelonida wrote:

> Hi everybody,  
> I hope the message does NOT show up three times.  
> My news client always reports errors and I don’t know whether the  
> message was sent out or not.

It was shown up at least 2 times. It may be not a good idea to  
post via gmane, probably subscribing directly instead would be  
better.

> [pid: 1205|app: 0|req: 537/1453] xx.xx.xx.33 () {40 vars in 1794  
> bytes} [Thu Jan 26 18:42:31 2012] POST /my\_url/run?var=123 =\>  
> generated 129 bytes in 94 msecs (HTTP/1.0 200) 3 headers in 174  
> bytes (1 switches on core 0)
> 
> However I don’t see any corresponding request logged in nginx log.
> 
> Is this the expected behaviour?  
> What could be the reason?
> 
> Ideally I would like to see all accesses in nginx’ access file.

All accesses are expected to be logged, unless logging is switched  
off. Note though:

1. requests are logged on completion, and if request processing  
and/or sending response to client takes a while - log line won’t  
appear till completion

2. requests are logged in configuration of a location where  
request ends; this may be quite different from one where  
processing reaches backend, especially if X-Accel-Redirect or  
error\_page redirections are used.

3. one request may hit easily hit backends several times (see  
above about redirections)

If you think something is wrong, you may build debug log to see  
what actually happens, see  
[A debugging log](http://nginx.org/en/docs/debugging_log.html).

Note that you have to configure one at global level, and make sure  
it’s not overriten at more specific levels (best solution is to  
comment out all other error\_log directives), else you are risking  
to miss debug log data as well.

> ```
> sendfile on;
> 
> ```
> 
> The probably relevant nginx config lines:  
> Actually, full configuration is relevant, including all  
> other includes. Else the information is mostly useless.

[…]

Maxim D.

---

<div class="post-metadata">

**Author:** ![Gelonida](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Gelonida](https://www.ruby-forum.com/u/Gelonida)\
**Post date:** [May 13, 2016, 2:47pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-seem-to-log-all-accesses-some-uwsgi-accesses-are-missing/216192/3 "2016-05-13T14:47:40Z")

</div>

??hi , did you got the answer?? i have the same problem

Posted at Nginx Forum:

> **[Re: nginx doesn't seem to log all accesses (some uwsgi accesses are missing)](https://forum.nginx.org/read.php?2,221737,266884#msg-266884)**
>
> Hi everybody, I hope the message does NOT show up three times. My news client always reports errors and I don't know whether the message was sent out or not. I'm having following setup: nginx \<-unix\_socket-\> uwsgi -\> django Wh
