Reputation: 3441
So I enabled error log and slow query log on MariaDB and I could see the data in log files. But after a couple of hours when I checked back again then they were empty. It is showing both log files size as 0 and now it is not creating new logs.
Machine has not been restarted during this time. Why all of sudden both error and slow query logs are now empty?
OS is Debian.
Upvotes: 0
Views: 751
Reputation: 142296
The error log rarely has anything.
The slowlog needs several settings to really get it "ON":
log_output = FILE
slow_query_log = ON
slow_query_log_file = (fullpath to some file)
long_query_time = 1
log_slow_admin_statements = ON -- (optional)
log_queries_not_using_indexes = OFF -- (optional)
Explanation and more discussion, plus recommendation on digesting the results: http://mysql.rjweb.org/doc.php/mysql_analysis#slow_queries_and_slowlog
Upvotes: 2