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

不羁的心 提交于 2020-01-02 07:22:13

问题


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

I'm using

  • symfony/symfony v2.4.6
  • symfony/monolog-bundle v2.6.0
  • doctrine/common v2.4.2

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?


回答1:


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



来源:https://stackoverflow.com/questions/24821769/symfony-2-4-cant-get-the-doctrine-channel-in-prod-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!