I'm not sure if it's lack of documentation but I can't find any information about where it is logged?
I've expected the query to be in /var/lib/proxysql/proxysql.log but nothing found.
I was also looking for a dedicated stats_mysql_query_log table - which would be in my opinion the most advanced option to store/receive/reset the queries with log flag set, since no shell access required, and after debugging it could easily be purged.
I've also set mysql-eventslog_filename to /var/lib/proxysql/query.log and the file query.log.00000001 is created - but nothing inside.
mysql> select rule_id,match_digest,log,hits from runtime_mysql_query_rules
left join stats_mysql_query_rules using (rule_id) where rule_id=10000\G
*************************** 1. row ***************************
rule_id: 10000
match_digest: .*
log: 1
hits: 2
1 row in set (0.01 sec)
Thanks for the report.
Logging is available but not very well documented.
Will work on this
any short hint where I can find the logs for now? :-)
Taking a flight so I will be short :)
Please have a look at #561 and https://github.com/sysown/proxysql/blob/master/tools/eventslog_reader_sample.cpp for an example on how to read the log file
like mentioned query.log.00000001 (eventslog_filename) is created but stays at size 0.
2016-10-09 10:17:01 [INFO] Starting new mysql log file /var/lib/proxysql/query.log.00000001`
while the log rule matches
mysql> select rule_id,match_digest,log,hits from runtime_mysql_query_rules
left join stats_mysql_query_rules using (rule_id) where rule_id=10000\G
*************************** 1. row ***************************
rule_id: 10000
match_digest: .*
log: 1
hits: 2
1 row in set (0.01 sec)
# ls -lah /var/lib/proxysql/query.log.00000001
-rw------- 1 root root 0 Oct 9 12:23 /var/lib/proxysql/query.log.0000000
have a good flight :-)
any update on that one? need the logging function since I've few queries which seem to miss defined rules and I don't know why and which ones. But they match on the .* log rule in the end, but I don't get any log.
Indeed, this was a bug. Now queries are logged.
Queries can be read using the sample tool eventslog_reader_sample. Here an example:
$ ./tools/eventslog_reader_sample /var/lib/proxysql/file1.log.00001258
ProxySQL LOG QUERY: thread_id="2" username="root" schemaname=information_schema" client="127.0.0.1:58307" HID=0 server="127.0.0.1:3306" starttime="2016-10-23 12:34:37.132509" endtime="2016-10-23 12:34:38.347527" duration=1215018us digest="0xC5C3C490CA0825C1"
select sleep(1)
ProxySQL LOG QUERY: thread_id="2" username="root" schemaname=information_schema" client="127.0.0.1:58307" HID=0 server="127.0.0.1:3306" starttime="2016-10-23 12:41:38.604244" endtime="2016-10-23 12:41:38.813587" duration=209343us digest="0xE9D6D71A620B328F"
SELECT DATABASE()
ProxySQL LOG QUERY: thread_id="2" username="root" schemaname=test" client="127.0.0.1:58307" HID=0 server="127.0.0.1:3306" starttime="2016-10-23 12:42:38.511849" endtime="2016-10-23 12:42:38.712609" duration=200760us digest="0x524DB8D7A9B4C132"
select aaaaaaa
Bug fixed in branch v1.3.1-dev
This is now released in v1.3.0c