Frank Martin
Frank Martin

Reputation: 3441

MariaDB error and slow query log became empty

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.

enter image description here

Upvotes: 0

Views: 751

Answers (1)

Rick James
Rick James

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

Related Questions