I need to see what redis gets/sets in the redis log.
I tried to set the redis log level to debug and verbose.
This does not show me anything when I set a value.
Unless it's important that you get in the log, in which case I don't think I can help you, you should be able to use the MONITOR command:
MONITOR is a debugging command that streams back every command processed by the Redis server. It can help in understanding what is happening to the database. This command can both be used via redis-cli and via telnet.
You could do something like:
redis-cli monitor | grep -E ' "(g|s)et" '
Note that there is a performance cost, though (it's mentioned in the linked docs as roughly 50%).
Pipe it to a file:
redis-cli monitor | grep -E ' "(g|s)et" ' > redis_get_set.log
redis-cli monitor > redis_get_set.log
works for me but redis-cli monitor | grep -E ' "(g|s)et" ' > redis_get_set.log
results in a file that remains empty. Any idea why that would be ? (Ubuntu 16.04) –
Astound redis-cli monitor | grep -E ' "(g|s)et" '
–
Propman redis-cli monitor | grep -E ' "(G|S)ET" '
. For my use case, I also wanted multi get and truncate oversized entries so I used redis-cli monitor | grep -E ' "M?(G|S)ET" ' | cut -b 1-240
. –
Blackboard I used redis-cli monitor > redis.log
and that works just fine for me, better than console.
RedisInsight is a free Redis GUI which contains a profiler.
(under the hood it just runs redis-cli monitor
)
It also has options to save the logs to a file if desired.
© 2022 - 2024 — McMap. All rights reserved.