I read over the query logging documentation
https://proxysql.com/documentation/query-logging/ and I didn't see any mention of it requiring a restart to create the initial /var/lib/proxysql/queries.log.00000001 but, unless I fully restart the ProxySQL service, that file never shows up. Is that a bug?
Steps to reproduce:
Clean Rocky Linux 8 install
RPM install proxysql-2.7.1-1.x86_64
Double checked all settings in place using the above documentation link, and verified:
> SELECT * FROM global_variables WHERE variable_name LIKE 'mysql-eventslog_%' ORDER BY variable_name;
+-----------------------------+----------------+
| variable_name | variable_value |
+-----------------------------+----------------+
| mysql-eventslog_default_log | 0 |
| mysql-eventslog_filename | queries.log |
| mysql-eventslog_filesize | 104857600 |
| mysql-eventslog_format | 2 |
+-----------------------------+----------------+
Insert the query rules for a sort of catch all log for a specific database:
> INSERT INTO mysql_query_rules (rule_id,active,schemaname,match_digest,log,apply) VALUES (1,1,'test-database','.',1,0);
LOAD MYSQL QUERY RULES TO RUNTIME; SAVE MYSQL QUERY RULES TO DISK;
Watch the /var/lib/proxysql, and /var/lib/proxysql/queries.log.00000001 isn't there. I restart ProxySQL:
sudo systemctl restart proxysql
...and the file instantly shows up.
Now, with the file finally there, I can delete the above query rule, add a different one, change to a different database, do various other edits and all continues to work. However, that file has to initially be there. Meaning, if I delete it to clean up space. Then ProxySQL will not recreate it even with an updated rule and the LOAD/SAVE commands. Only a restart will get the file(s) to come back.
So, even though not documented, a restart is required? Or is this a bug?