symfony 2.4无法在prod环境中获得学说渠道

时间:2014-07-18 09:36:27

标签: symfony doctrine-orm monolog

我无法在我的生产环境中记录学说渠道。

我正在使用

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

这是config_prod.yml中我的monolog配置:

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"]

以下是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

我有3个文件

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

我无法获得prod_doctrine.log

我尝试了同一个文件prod.log中的所有频道。除了教条之外,我的所有频道都很好......

什么可以阻止学说的记录?是否与我的版本有些不兼容?

1 个答案:

答案 0 :(得分:6)

doctrine.dbal.logging设置为true以启用生产原则记录。