# Slow\_query\_log\_file issue

**URL:** <https://forums.percona.com/t/slow-query-log-file-issue/29259>\
**Category:** Percona Server for MySQL 8.0\
**Tags:** percona\
**Created:** [March 20, 2024, 4:26pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259 "2024-03-20T16:26:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hussain\_Patel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hussain_patel/32/17808_2.png) [@Hussain\_Patel](https://forums.percona.com/u/Hussain_Patel)\
**Post date:** [March 20, 2024, 4:26pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/1 "2024-03-20T16:26:53Z")

</div>

Hi Team,

we are facing issue with naming the slow query log file. We have following setting in my.cnf  
Server Version:  
Server version: 8.0.35-27 Percona Server (GPL), Release 27, Revision 2f8eeab2

max\_slowlog\_files=2

max\_slowlog\_size=100000000

slow\_query\_log\_file=test\_slow.log

slow\_query\_log=ON

After DB start the name appears to be as below in show global variables.

| slow\_query\_log\_file | /mydata/data/…/.log.000001 |.

Seems its not picking up the correct name.

Also if we give relative path in my.cnf as below

slow\_query\_log\_file=/home/mysqld/test\_slow.log

After db restart the global variables shows as below:

| slow\_query\_log\_file | /mydata/data/…/.log.000001 |

Also if we set global variables :  
set @@global.slow\_query\_log\_file=‘/home/mysqld/test\_slow.log’;

status shows good:  
| slow\_query\_log\_file | /home/mysqld/test\_slow.log.000001 |

Please help check why its not picking the correct name from my.cnf

---

<div class="post-metadata">

**Author:** ![Mauricio\_Cacho](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mauricio_cacho/32/5859_2.png) [@Mauricio\_Cacho](https://forums.percona.com/u/Mauricio_Cacho)\
**Post date:** [March 20, 2024, 6:57pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/2 "2024-03-20T18:57:07Z")

</div>

Hi @Hussain_Patel.

My first guess would be, there’s another configuration file that’s being read at startup.

You can refer to the [documentation](https://dev.mysql.com/doc/refman/8.0/en/option-files.html#option-file-order), i.e for Linux systems, MySQL will read **ALL** of the following:  
**Table 6.2 Option Files Read on Unix and Unix-Like Systems**

| File Name | Purpose |
| --- | --- |
| `/etc/my.cnf` | Global options |
| `/etc/mysql/my.cnf` | Global options |
| `SYSCONFDIR`/my.cnf | Global options |
| `$MYSQL_HOME/my.cnf` | Server-specific options (server only) |
| `defaults-extra-file` | The file specified with [`--defaults-extra-file`](https://dev.mysql.com/doc/refman/8.0/en/option-file-options.html#option_general_defaults-extra-file), if any |
| `~/.my.cnf` | User-specific options |
| `~/.mylogin.cnf` | User-specific login path options (clients only) |
| `DATADIR`/mysqld-auto.cnf | System variables persisted with [`SET PERSIST`](https://dev.mysql.com/doc/refman/8.0/en/set-variable.html) or [`SET PERSIST_ONLY`](https://dev.mysql.com/doc/refman/8.0/en/set-variable.html) (server only) |

Also, if you have `!includedir` or `!include` on any of your configuration files, those will be read as well.

Keep in mind MySQL will read all the values, and it will end up with the last value read; so if the parameter is configured on two different places, the value will be the last “read”.

One other thing to check would be to confirm you’re setting the value on the correct group, i.e not under [client] section.

Best,  
Mauricio.

---

<div class="post-metadata">

**Author:** ![Hussain\_Patel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hussain_patel/32/17808_2.png) [@Hussain\_Patel](https://forums.percona.com/u/Hussain_Patel)\
**Post date:** [March 20, 2024, 7:12pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/3 "2024-03-20T19:12:30Z")

</div>

Yes this all is taken care of and not bec of above any.  
Seems to be issue with the server.  
Can you test in your env once.

---

<div class="post-metadata">

**Author:** ![Mauricio\_Cacho](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mauricio_cacho/32/5859_2.png) [@Mauricio\_Cacho](https://forums.percona.com/u/Mauricio_Cacho)\
**Post date:** [March 20, 2024, 11:47pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/4 "2024-03-20T23:47:20Z")

</div>

Thanks for flagging this.

I’ve tried on a test environment and confirmed the behaviour as you mentioned.  
It does seem to be a bug, I’ll try to check a bit further and ask internally before creating a bug ticket.

One thing I’ve noticed (On the latest version, maybe it’s the same on 8.0.35-27), the log is being created with the correct name.

i.e., when you set in your cnf file this:

> slow\_query\_log\_file=test\_slow.log

You should be able to see the log file with the correct name in your datadir (//test\_slow.log  
.XXXXXX), even though the incorrect name shows when checking the global variables.

We’ll keep looking into this.  
Thanks again for reaching out.  
Best,  
Mauricio.

---

<div class="post-metadata">

**Author:** ![Hussain\_Patel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hussain_patel/32/17808_2.png) [@Hussain\_Patel](https://forums.percona.com/u/Hussain_Patel)\
**Post date:** [March 21, 2024, 3:43pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/5 "2024-03-21T15:43:10Z")

</div>

Thanks @Mauricio_Cacho

Please share the link to the bug once you report it.

Thanks  
Hussain

---

<div class="post-metadata">

**Author:** ![Hussain\_Patel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hussain_patel/32/17808_2.png) [@Hussain\_Patel](https://forums.percona.com/u/Hussain_Patel)\
**Post date:** [March 27, 2024, 3:59pm UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/6 "2024-03-27T15:59:24Z")

</div>

Hi @Mauricio_Cacho Were you able to check with your team or file a bug?

Thanks  
Hussain

---

<div class="post-metadata">

**Author:** ![Mauricio\_Cacho](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mauricio_cacho/32/5859_2.png) [@Mauricio\_Cacho](https://forums.percona.com/u/Mauricio_Cacho)\
**Post date:** [March 28, 2024, 1:19am UTC](https://forums.percona.com/t/slow-query-log-file-issue/29259/7 "2024-03-28T01:19:27Z")

</div>

Hi @Hussain_Patel , sorry for the delay.

I’ve informed the team, a similar bug was created the same day:  
[https://perconadev.atlassian.net/browse/PS-9156](https://perconadev.atlassian.net/browse/PS-9156)

Best,  
Mauricio.
