Fix issue with cache key, add logging support