Back to Redis

SLOWLOG LEN

content/commands/slowlog-len.md

latest1.4 KB
Original Source

This command returns the current number of entries in the slow log.

A new entry is added to the slow log whenever a command exceeds the execution time threshold defined by the slowlog-log-slower-than configuration directive. The maximum number of entries in the slow log is governed by the slowlog-max-len configuration directive. Once the slog log reaches its maximal size, the oldest entry is removed whenever a new entry is created. The slow log can be cleared with the [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) command.

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | Not supported for [scripts]({{<relref "/develop/programmability">}}). |

Return information

{{< multitabs id="slowlog-len-return-info" tab1="RESP2" tab2="RESP3" >}}

Integer reply: the number of entries in the slow log.

-tab-sep-

Integer reply: the number of entries in the slow log.

{{< /multitabs >}}