-
Notifications
You must be signed in to change notification settings - Fork 976
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
feat: Add logrotate script and update log location #1963
Conversation
Write to /var/log/proxysql.log by default, and add a logrotate script which manages this path. Unfortunately, the logrotate script can't use `PROXYSQL FLUSH LOGS;` to tell ProxySQL to rotate file handles*, so we use copytruncate instead. It would be nice if ProxySQL could rotate file handles following a signal in future... * For two reasons: 1. There's no safe / standard way to find admin credentials 2. mysql(1) client may not be installed
Automated message: PR pending admin approval for build testing |
I like it, thanks! |
I have installed Proxysql 2.0.3 on Ubuntu 18.04. But after installation, the log file was not generated. But Im not able to find the log file. Tried to manually created with Workaroud: (Im using the old log file location)
Save
restart proxysql |
Just to be sure are you specifying the log path in your config file? Can
you check /process/$pid/fd and see if there is a link to the file in there?
…On Thu., 28 Mar. 2019, 20:27 BhuviTheDataGuy, ***@***.***> wrote:
I have installed Proxysql 2.0.3 on Ubuntu 18.04. But after installation,
the log file was not generated.
I checked at /var/lib/proxysql/(previous version location) and /var/log.
But Im not able to find the log file. Tried to manually created with chown
proxysql:proxysql /var/log/proxysql.log , but thats not working.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1963 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXKdXV0Kk6ldNni3ZG_7iCuK4BI0ZYpks5vbIr-gaJpZM4b-h71>
.
|
Manually added the log file location as Then
Default config (/var/log/proxysql.log)
|
I understand the issue(s):
I'm not sure why it failed once you created the log file by hand. I performed the same test and things worked. I'm testing a fix locally now... |
Hey @alexjurkiewicz Thanks for your effort. I tried to reproduce one more time on a fresh VM.
Below are the steps I have done.
But Im not able to find the log file. Then manually creating the log file.
But still the log file is empty. |
I've pushed a branch Build error log snippet from
|
One more update:Same issue found on CentOs7. But we can run this to fix it. Fix:
|
@BhuviTheDataGuy / @alexjurkiewicz We've discussed internally and decided to move the default path back to I've also added some additional fixes for the logrotate location in this PR: #1991 |
Hey @pondix Thanks for the fix. |
Write to /var/log/proxysql.log by default, and add a logrotate script
which manages this path.
Unfortunately, the logrotate script can't use
PROXYSQL FLUSH LOGS;
totell ProxySQL to rotate file handles*, so we use copytruncate instead.
It would be nice if ProxySQL could rotate file handles following a
signal in future...
* For two reasons: