etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

Logging support for queries? #101

Closed danishin closed 8 years ago

danishin commented 8 years ago

Hello, first of all, thank you so much for working on this. What a great library.

I'm looking for something like other jdbc-library-like query logging supports (for example, statement logging in SQL). I've set redis to debug level in logback.xml but it seems to only support the actor connection and disconnection and the kind but not logging for the actual queries.

Am I missing something here or is it not supported? Thank you!

etaty commented 8 years ago

It is not supported so far.

Redis is just communicating with simple commands while SQL is a language (that is often generated), so I am not sure it is useful.

Otherwise you have http://redis.io/commands/MONITOR

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.

danishin commented 8 years ago

Thanks for the suggestion. I often like to log out everything when there is a need for debugging so I find this useful but I agree that it's not essential enough to be part of the library.

How should I go about sending MONITOR command? So far, I haven't found rediscala command to send arbitrary command? Is there a low-level method that I can access?

Also is listening supported in rediscala for this type of matter?

Thanks for your help

etaty commented 8 years ago

monitor is a cli command (you don't use it in a normal codebase, so it is not included in rediscala) But you can use it with the redis console : redis-cli on your terminal

danishin commented 8 years ago

I guess that'll do the job. Thanks for your help!