nginx_tcp_proxy_module icon indicating copy to clipboard operation
nginx_tcp_proxy_module copied to clipboard

reload log file (logrotate)

Open splitice opened this issue 13 years ago • 6 comments

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.

splitice avatar Jul 27 '12 14:07 splitice

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

Thanks.

yaoweibin avatar Jul 27 '12 14:07 yaoweibin

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]; }"

splitice avatar Jul 27 '12 15:07 splitice

In my server, it worked for me. Maybe the log is buffered? Try more test request.

If it still not work, You can email me your full configure file.

Thanks.

On 2012-7-27 23:01, splitice wrote:

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]; }"


Reply to this email directly or view it on GitHub: https://github.com/yaoweibin/nginx_tcp_proxy_module/issues/50#issuecomment-7307557

Thanks, -Weibin Yao

yaoweibin avatar Jul 27 '12 15:07 yaoweibin

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.

splitice avatar Jul 27 '12 15:07 splitice

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.

splitice avatar Jul 28 '12 16:07 splitice

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

yaoweibin avatar Jul 29 '12 12:07 yaoweibin