You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to implement standard log rotation mechanism using signal handling?
An example of a good mechanism for log rotation is nginx, which does log rotation via SIGUSR1: when the nginx binary receives this signal, it closes and reopens the log file descriptors. This is used in tandem with logrotate by creating a configuration for nginx in /etc/logrotate.d which contains a postrotate script kill -USR1 $NGINX_PID. logrotate rotates the logs, then signals nginx to close and reopen logs so that nginx has the correct logs open for writing.
The text was updated successfully, but these errors were encountered:
@samveen , To reduce the open file handlers, the console log files under /var/log/goconserver/nodes/ are closed immediately after writing, in this way, log rotation should be supported. After some testing from @neo954 , the performance may not be influenced too much.
For the log for goconserver itself under /var/log/goconserver/server.log, HUP signal handler is used to restart the logger.
Is it possible to implement standard log rotation mechanism using signal handling?
An example of a good mechanism for log rotation is
nginx
, which does log rotation viaSIGUSR1
: when the nginx binary receives this signal, it closes and reopens the log file descriptors. This is used in tandem withlogrotate
by creating a configuration for nginx in/etc/logrotate.d
which contains apostrotate
scriptkill -USR1 $NGINX_PID
. logrotate rotates the logs, then signals nginx to close and reopen logs so that nginx has the correct logs open for writing.The text was updated successfully, but these errors were encountered: