Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see set/get/ in redis log

Tags:

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.

like image 892
Itay Moav -Malimovka Avatar asked Feb 05 '13 17:02

Itay Moav -Malimovka


2 Answers

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
like image 92
Linus Thiel Avatar answered Sep 24 '22 11:09

Linus Thiel


I used redis-cli monitor > redis.log and that works just fine for me, better than console.

like image 21
Sofi Avatar answered Sep 22 '22 11:09

Sofi