The keys for the request log entries are stored in a sorted set.
Keys are removed from the set when it reaches full capacity, but the request log entries themselves are never removed. This results in redis eventually filling up all available memory with request log entries.
The keys that are removed from the sorted set need to be removed from the database also.
var key = UrnId.Create<RequestLogEntry>(entry.Id).ToLower();
var nowScore = DateTime.UtcNow.ToUnixTime();
using (var trans = redis.CreateTransaction())
{
trans.QueueCommand(r => r.AddItemToSortedSet(SortedSetKey, key, nowScore));
trans.QueueCommand(r => r.Store(entry));
if (loggerCapacity != null)
{
//entry itself is not removed from redis???
trans.QueueCommand(r => r.RemoveRangeFromSortedSet(SortedSetKey, 0, -loggerCapacity.Value - 1));
}
trans.Commit();
}