Skip to content

reload log file (logrotate) #50

splitice opened this Issue Jul 27, 2012 · 6 comments

2 participants


When the nginx daemon is reloaded, the logfile handle isnt updated.

It is common for logrotate to change move the file and then reload nginx to reload the handle to log to a new file.


You means the tcp_access.log will not update after reload? Can you show me your nginx.conf?



Yes. the TCP log file. My config file is rather large and contains some semi-sensitive IP addresses Ill email it to you?

Its key features:

  • Lots of TCP server entries
  • Each follows a specific template

"server {
listen [HostIP]:[HostPort];

access_log /var/log/proxy/tcp.log buffer=2K;
proxy_pass [UpstreamName];


Hmm for me its working on one server but not on the other, perhaps it has something to do with the sheer quantity of reloads?

This servers config is updated atleast once every 5 minutes on average. Each time getting reloaded. Additionally logrotate runs hourly.

I just moved the config file, reloaded the server and will come back in the morning after many GBs of traffic and take a look.


Hmm strange, I came back and one server had an empty log file that wasnt updating. Seems to have something to do with the number of reloads. I will do some more testing and get back to you.


Thanks. I'll also do more tests in my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.