-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: A way to safely rotate log files #1049
Comments
I just found that Using a logrotate config similar to this one:
I test this out by running
Next, flush logs with
Inspecting the log files:
While the old file won't continue to grow, it will continue to occupy space on disk until it is closed. |
When ProxySQL starts as a daemon, it forks immediately. |
Fixed in future release 1.4.1 |
The here mentioned lograte configuration is also implemented by @EvgeniyPatlan in The problem is that this empty log after logrotate problem is still open in 1.4.3 percona package.with above configuration.
|
To clarify, are you saying |
no, that is working fine:
Only the above mentioned logrotate config which is packaged in Perconas
gets empty log after each daily logrotate. Only adding it here because it fits to the logrotate config file and there is no issue tracker on the other repo but both are (more or less) from Percona offered/supported. |
@Reiner030 we have changed logrotate config file for 1.4.3 so am I right that the issue still exists? |
Hi, Fresh ProxySQL setup using Percona's repo v1.4.3-1.1.xenial. The logrotate script does not work for /var/lib/proxysql/proxysql.log, but works for the other logs. After setting passwordless login with:
To make it work, I have changed the logrotate file to do a "PROXYSQL FLUSH LOGS" after the rotation:
Maybe there are other ways to solve this without having to set login_path. |
thanks for the info @vrrc |
Still see the error after logrotate and so failed to log into error log on v1.4.10
|
I need to ask, if there's a guide somewhere to make logrotate work for ProxySQL? I'm running Ubuntu 16.04 and ProxySQL 1.4.9, and it just creates a zipped copy of the latest logfile - but never creates a new /var/lib/proxysql/proxysql.log ? I can't get logrotate to reveal why it's not working for it. ( My latest atttempt is this, using the mysql_config_editor and "--login-path" - and I will know tomorrow morning if THAT'S the way to succeed :) ) |
Thank you so much. Log rotation was driving me mad. The official documentation is not correct. Your way of doing logrotate worked as expected. |
In order to prevent unbounded logfile growth it would be nice to support logfile rotation without needing to restart the process. Handling a
SIGHUP
(or a flag or something) to signal the process to close and reopen files would be very helpful.The text was updated successfully, but these errors were encountered: