<div dir="ltr"><div><br></div><div>The name of the file is really sort of irrelevant. The file descriptor will still point at <span style="font-size:13px;font-family:arial,sans-serif">$ACCESS_LOG_DROPBOX/$LOG_</span><span style="font-size:13px;font-family:arial,sans-serif">FILENAME. Any log lines between MV and KILL *should* still be written there. </span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Why not use logrotate? Why not use nginx reload? Why not use HUP? </span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 19, 2014 at 12:36 PM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, May 19, 2014 at 03:06:06PM -0400, samingrassia wrote:<br>
<br>
Hi there,<br>
<div class=""><br>
> mv $NGINX_ACCESS_LOG $ACCESS_LOG_DROPBOX/$LOG_FILENAME<br>
> kill -USR1 `cat $NGINX_PID`<br>
><br>
> My questions is during time between the mv and the kill, is there any log<br>
> writes that are being discarded or are they being stacked in memory and<br>
> dumped into the new access.log after it is recreated?<br>
<br>
</div>What happens when you do<br>
<br>
mv $NGINX_ACCESS_LOG $ACCESS_LOG_DROPBOX/$LOG_FILENAME<br>
<br>
and then issue a http request of your nginx server, before the kill?<br>
<br>
Do you see the log line go into $NGINX_ACCESS_LOG; onto the end of<br>
$ACCESS_LOG_DROPBOX/$LOG_FILENAME; or disappear without being written<br>
anywhere?<br>
<br>
I'd expect the first option not to happen; the second option to happen<br>
if the "mv" is a "rename"; and the third option to happen if the "mv"<br>
is a "copy and delete". So make sure that your "mv" is a "rename",<br>
and you'll be fine.<br>
<br>
Actually, I'd expect the first option to happen if you are using variables<br>
in your log file name, according to its documentation.<br>
<span class="HOEnZb"><font color="#888888"><br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>