how to disable security.info and security.debug in monolog symfony2 logging

蓝咒 提交于 2019-12-11 06:29:58

问题


I constantly am seeing a bunch of the following log:

[2015-02-15 09:08:16] request.INFO: Matched route "AppMainBundle_daftar_toko_province" (parameters: "_controller": "App\MainBundle\Controller\ZHomepageController::daftarTokoAction", "provinceName": "DKI JAKARTA", "_route": "AppMainBundle_daftar_toko_province") [] []
[2015-02-15 09:08:16] security.INFO: Populated SecurityContext with an anonymous Token [] []
[2015-02-15 09:08:16] security.DEBUG: Write SecurityContext in the session [] []

in my prod.log, how can I disable this and I just want to see the errors. Here is my monolog settings:

monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: file
            excluded_404s:
                - ^/items/
        file:
            type: stream
            level: debug
        doctrine:
            action_level: debug
            type:  stream
            path:  %kernel.logs_dir%/doctrine_%kernel.environment%.log
            channels: doctrine

回答1:


You can define which channels to be logged. Use something like this to ignore a specific channel:

        channels: ["!security"]

If you only want to ignore specific log levels you can use the level param or use a combination of both in a new handler.



来源:https://stackoverflow.com/questions/28523211/how-to-disable-security-info-and-security-debug-in-monolog-symfony2-logging

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