diff --git a/allstarr/Services/Common/RedisCacheService.cs b/allstarr/Services/Common/RedisCacheService.cs index 922a2d5..50b59c1 100644 --- a/allstarr/Services/Common/RedisCacheService.cs +++ b/allstarr/Services/Common/RedisCacheService.cs @@ -56,7 +56,16 @@ public class RedisCacheService try { - return await _db!.StringGetAsync(key); + var value = await _db!.StringGetAsync(key); + if (value.HasValue) + { + _logger.LogDebug("Redis cache HIT: {Key}", key); + } + else + { + _logger.LogDebug("Redis cache MISS: {Key}", key); + } + return value; } catch (Exception ex) { @@ -93,7 +102,12 @@ public class RedisCacheService try { - return await _db!.StringSetAsync(key, value, expiry); + var result = await _db!.StringSetAsync(key, value, expiry); + if (result) + { + _logger.LogDebug("Redis cache SET: {Key} (TTL: {Expiry})", key, expiry?.ToString() ?? "none"); + } + return result; } catch (Exception ex) {