6

What is best practices to log the doctrine queries with monolog? I started with symfony a week ago.

1 Answer 1

6

In your configuration, set the doctrine.dbal.logging to true.

# app/config/config.yml

doctrine:
    dbal:
        driver:  pdo_mysql
        # ...
        logging: true

In fact, queries are logged by default in dev environment by setting the value through the kernel.debug parameter, e.g. logging: %kernel.debug%.

See DoctrineBundle configuration.

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.