Alsciende
Alsciende

Reputation: 26971

symfony 2.4 can't get the doctrine channel in prod environment

I can't manage to get a log of the doctrine channel in my prod environment.

I'm using

Here is my monolog config in config_prod.yml:

monolog:
    handlers:
        doctrine:
            bubble: false
            action_level: DEBUG
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%_doctrine.log"
            channels: doctrine
        security:
            bubble: false
            action_level: DEBUG
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%_security.log"
            channels: security
        request:
            bubble: false
            action_level: DEBUG
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%_request.log"
            channels: request
        main:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            channels: ["!doctrine", "!security", "!request"]

Here is my whole doctrine config in config.yml:

doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

I have the 3 files

../../../logs/prod.log
../../../logs/prod_request.log
../../../logs/prod_security.log

I can't manage to get prod_doctrine.log.

I tried all the channels in the same file prod.log. I had all channels alright, except doctrine...

What can prevent the logging of doctrine? Is there some incompatibility with my versions?

Upvotes: 4

Views: 2742

Answers (1)

Eternal1
Eternal1

Reputation: 5625

Set doctrine.dbal.logging to true to enable production doctrine logging.

Upvotes: 7

Related Questions