title: how to log/trace redis calls from java spring app
body: <p>I'm looking for the simplest way to log the redis activity originating from my java springboot microservice (queries and responses). </p>
  
  <p>I want to see (in the main springboot log file) log lines whenever data is extracted/inserted from/to redis. </p>
  
  <p>My code use the typical spingframework data redis approach like this:</p>
  
  <pre><code>import org.springframework.data.redis.core.RedisHash;
  import org.springframework.data.redis.core.TimeToLive;
  
  @RedisHash
  public class InternalAddress {
      private String county;
      private String postcode;
      @TimeToLive
      private Long expiry;
  }
  </code></pre>
  
  <p>*</p>
  
  <pre><code>import org.springframework.data.repository.CrudRepository;
  
  public interface AddressRepository extends CrudRepository&lt;InternalAddress, String&gt; {}
  </code></pre>
  
  <p>I tried to enable some logging like this. </p>
  
  <pre><code>logging:
    level:
      root: INFO
      redis.clients: TRACE
      org.springframework.data: TRACE
  </code></pre>
  
  <p>but what i get is totally useless to me: either nothing or just some info about connections being opened or closed... </p>
  
  <p>what i want to see in my log is this really:</p>
  
  <pre><code>2017-11-28T16:05:18.140+00:00 HGETALL key5645 =&gt; {...returned data...}
  2017-11-28T16:05:25.140+00:00 LPUSH whatever
  2017-11-28T16:05:25.140+00:00 HMSET blahblahblah
  </code></pre>
  
  <p>Any idea? did i miss the right class i should be tracing? </p>
  
  <p>Is there some custom interceptor/listener/aop code i need to write?</p>
  
  <p>Any other approach? Thanks in advance</p>