From de32c37c06ee447d5d7d3505725c100da2c03c75 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 30 Jun 2011 15:54:05 +0200 Subject: [PATCH] More redis.conf self-documentation. Now even queries that took exactly server.slow_log_slower_than are logged, as this is not exact but is more intuitive for people, and a value of 0 will force every query to be logged. --- redis.conf | 6 ++++++ src/slowlog.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/redis.conf b/redis.conf index 456ffa85..1551a13a 100644 --- a/redis.conf +++ b/redis.conf @@ -327,7 +327,13 @@ auto-aof-rewrite-min-size 64mb # slow log. When a new command is logged the oldest one is removed from the # queue of logged commands. +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. slowlog-log-len 1024 ############################### ADVANCED CONFIG ############################### diff --git a/src/slowlog.c b/src/slowlog.c index a257a17b..17edf615 100644 --- a/src/slowlog.c +++ b/src/slowlog.c @@ -55,7 +55,7 @@ void slowlogInit(void) { * configured max length. */ void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration) { if (server.slowlog_log_slower_than < 0) return; /* Slowlog disabled */ - if (duration > server.slowlog_log_slower_than) + if (duration >= server.slowlog_log_slower_than) listAddNodeHead(server.slowlog,slowlogCreateEntry(argv,argc,duration)); /* Remove old entries if needed. */ -- 2.47.2