snc / SncRedisBundle

A Redis bundle for Symfony supporting Predis and PhpRedis
https://github.com/snc/SncRedisBundle
MIT License
1.04k stars 328 forks source link

What is the advantage of Snc's Monolog Redis Handler over the one provided by Monolog? #122

Closed epicwhale closed 10 years ago

epicwhale commented 10 years ago

I noticed that Monolog officially has a handler for Redis - https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/RedisHandler.php

If I want to store all my symfony2 logs into Redis, which one should I be using today?

snc commented 10 years ago

At the time this feature was added there was no redis handler in monolog. You can use this bundle to configure a redis client and then use this client service in your monolog redis handler.

epicwhale commented 10 years ago

@snc Been trying to get this right since hours. Getting a CircularReferenceException

ServiceCircularReferenceException: Circular reference detected for service "monolog_redis_handler", path: "cache_warmer -> router -> monolog.logger.router -> monolog_redis_handler -> snc_redis.logging -> snc_redis.logger -> monolog.logger.snc_redis".

Here is my configuration - http://pastie.org/private/lfxtbu6axcz6nwnkrrmiww

epicwhale commented 10 years ago

By setting logging:false, I was able to circumvent this issue. Also, I'm now successfully being able to use Monolog's in-built redis handler.. I suppose we should transition SNC to use that internally too?

snc commented 10 years ago

Yes definitely a good idea.