# Mysql 5.7.39 Error logs getting empty on ubuntu 18.04

**URL:** <https://forums.percona.com/t/mysql-5-7-39-error-logs-getting-empty-on-ubuntu-18-04/19206>\
**Category:** Uncategorized\
**Created:** [December 20, 2022, 9:01am UTC](https://forums.percona.com/t/mysql-5-7-39-error-logs-getting-empty-on-ubuntu-18-04/19206 "2022-12-20T09:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavanmysql](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pavanmysql/32/7152_2.png) [@Pavanmysql](https://forums.percona.com/u/Pavanmysql)\
**Post date:** [December 20, 2022, 9:01am UTC](https://forums.percona.com/t/mysql-5-7-39-error-logs-getting-empty-on-ubuntu-18-04/19206/1 "2022-12-20T09:01:03Z")

</div>

Hello MySQL Percona Community,

We have mysql 5.7.39 on ubuntu 18.04 , i have observed my error log always empty and my error log location is /var/log/mysql. is it auto rotating , where this auto rotation is configured? is my error logs redirected to any other files? want to check errors log and fix this. can someone help on this.

root:/var/log/mysql# ls -lhrt  
total 12K  
-rw-r----- 1 mysql adm 32 May 8 2022 error.log.8.gz  
-rw-r----- 1 mysql adm 0 Dec 20 06:25 error.log  
-rw-r----- 1 mysql adm 4.8K Dec 20 06:25 error.log.1

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 20, 2022, 1:37pm UTC](https://forums.percona.com/t/mysql-5-7-39-error-logs-getting-empty-on-ubuntu-18-04/19206/2 "2022-12-20T13:37:24Z")

</div>

Check /etc/logrotate.d This is a common log rotator that is not part of MySQL but usually rotates other application logs.

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [December 20, 2022, 1:39pm UTC](https://forums.percona.com/t/mysql-5-7-39-error-logs-getting-empty-on-ubuntu-18-04/19206/3 "2022-12-20T13:39:47Z")

</div>

Looking at the compressed files for the error log looks like logrotate is configured.

Check cronjobs for user ‘mysql’ and ‘adm’ to see if logrotate is configured.

Also, you can check,  
cat /var/lib/logrotate/status

One more way to test this is, change mysql error log path in my.cnf  
log\_error=/var/log/mysql\_1.log

if it works then the original issue caused due to logrotate or some external log rotating script
