# Why the slow query doesn't log in slowlog file

**URL:** <https://discuss.elastic.co/t/why-the-slow-query-doesnt-log-in-slowlog-file/359255>\
**Category:** Elasticsearch\
**Created:** [May 10, 2024, 11:30am UTC](https://discuss.elastic.co/t/why-the-slow-query-doesnt-log-in-slowlog-file/359255 "2024-05-10T11:30:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJ\_Zhu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dj_zhu/32/99543_2.png) [@DJ\_Zhu](https://discuss.elastic.co/u/DJ_Zhu)\
**Post date:** [May 10, 2024, 11:30am UTC](https://discuss.elastic.co/t/why-the-slow-query-doesnt-log-in-slowlog-file/359255/1 "2024-05-10T11:30:35Z")

</div>

Server Version: 6.8.6

On the client side, the response indicates that the query execution time was 394ms:

```auto
{"took":394,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":

```

However, despite setting the following configuration:

```auto
{
   "index": {
      "search": {
         "slowlog": {
            "level": "debug",
            "threshold": {
               "fetch": {
                  "debug": "300ms"
               },
               "query": {
                  "debug": "300ms"
               }
            }
         }
      }
   }
}

```

No slow log pertaining to this query can be found. It seems that the slow log on the server side only captures the time spent on a single node and a single shard. If this assumption is correct, how can I configure the server to log all slow queries whose total execution time exceeds the specified threshold?
