0

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Also do "FLUSH SLOW LOGS;", as you (Rick) suggested in another post. That populated the file with data regarding recent slow logs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.