gpt4 book ai didi

Symfony3+PHP单元。如何禁用控制台中的调试日志?

转载 作者:行者123 更新时间:2023-12-02 09:26:07 25 4
gpt4 key购买 nike

我想我在所有地方都关闭了调试日志记录(在 config.yml、config_dev、config_test 中):

monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
console:
type: stream
path: "%kernel.logs_dir%/console.log"
level: critical
channels: [!event]

但是当我运行 phpunit 时它会显示调试日志:

[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Component\\HttpKernel\\EventListener\\DumpListener::configure"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Bundle\\FrameworkBundle\\EventListener\\TestSessionListener::onKernelRequest"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener::onKernelRequest"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener::onKernelRequest"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"} []
[2016-06-19 16:53:29] event.DEBUG: Notified event "{event}" to listener "{listener}". {"event":"kernel.request","listener":"AppBundle\\EventListener\\LocaleListener::onKernelRequest"} []

如何禁用它?

最佳答案

如果您尝试这样做:

  console:
type: stream
path: "%kernel.logs_dir%/console.log"
level: critical
channels: []

那应该没问题。我对此也有一些问题,我只是根据我的需要对其进行了评论。如果你还想对 doctrine 进行一些调试,只需将 !doctrine 放在括号中即可。如果我没猜错,那就是你需要的。

关于Symfony3+PHP单元。如何禁用控制台中的调试日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37908010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com