0

When I am running Symfony command (with bin/console) I'm getting Redis logs in the output.

For example:

$ bin/console doctrine:generate:entities AppBundle:Item

[2017-10-18 13:26:47] cache.WARNING: Failed to save key "{key}" ({type}) {"key":"%5BAppBundle%5CEntity%5CItem%40%5BAnnot%5D%5D%5B1%5D","type":"array","exception":null}
[2017-10-18 13:26:47] cache.WARNING: Failed to save key "{key}" ({type}) {"key":"%5B%5BC%5DAppBundle%5CEntity%5CItem%24property_1%40%5BAnnot%5D%5D%5B1%5D","type":"integer","exception":null}
[2017-10-18 13:26:47] cache.WARNING: Failed to save key "{key}" ({type}){"key":"%5B%5BC%5DAppBundle%5CEntity%5CItem%24property_2%40%5BAnnot%5D%5D%5B1%5D","type":"integer","exception":null}
Generating entity "AppBundle\Entity\Item"
[2017-10-18 13:26:47] cache.WARNING: Failed to save key "{key}" ({type}) {"key":"%5B%5BC%5DAppBundle%5CEntity%5CItem%24property_3%40%5BAnnot%5D%5D%5B1%5D","type":"integer","exception":null}
... and at least 100 more

 > backing up Item.php to Item.php~
 > generating AppBundle\Entity\Item

This makes the actual output of commands hard to read.

1 Answer 1

1

The snc_redis.phpredis.default / Snc\RedisBundle\Client\Phpredis\Client service is just a wrapper around the original \Redis class to add the logging.

You can either turn off logging for a instance of the configuration, or use the Redis class directly.

The logging is usually set to "%kernel.debug%", which should avoid logging in env=prod.

snc_redis:
    clients:
        default:
            type: predis
            alias: default
            dsn: redis://localhost
            # usually "%kernel.debug%" to enable in dev
            logging: false

If you aren't using sncRedis, we'd need more info of what mechanism you are using to be able to help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.