chore: Adding cache logs for debugging (#17029)

This commit is contained in:
Trisha Anand 2022-09-23 23:24:27 +05:30 committed by GitHub
parent 28a3fc6625
commit 936ef75841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,7 @@ public class RedisCacheManagerImpl implements CacheManager {
.switchIfEmpty(Mono.defer(() -> {
//This is a cache miss, update stats and return empty
statsMap.get(cacheName).getMisses().incrementAndGet();
log.debug("Cache miss for key {}", path);
return Mono.empty();
}));
}
@ -80,6 +81,7 @@ public class RedisCacheManagerImpl implements CacheManager {
public Mono<Boolean> put(String cacheName, String key, Object value) {
ensureStats(cacheName);
String path = cacheName + ":" + key;
log.debug("Cache entry added for key {}", path);
return reactiveRedisTemplate.opsForValue().set(path, value);
}
@ -88,6 +90,7 @@ public class RedisCacheManagerImpl implements CacheManager {
ensureStats(cacheName);
statsMap.get(cacheName).getSingleEvictions().incrementAndGet();
String path = cacheName + ":" + key;
log.debug("Cache entry evicted for key {}", path);
return reactiveRedisTemplate.delete(path).then();
}