Symfony使用的记录器Monolog内置了对FirePHP和ChromePHP的支持.
在Symfony Standard Edition中,您可以在应用程序配置中配置monolog处理程序.
FirePHP和ChromePHP处理程序甚至存在config_dev.yml
,但已被注释掉:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
console:
type: console
channels: [!event, !doctrine]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
Run Code Online (Sandbox Code Playgroud)
在浏览器中查看日志所需要做的就是取消注释所需的处理程序.
目前,VarDumper组件不支持将任何内容转储到浏览器的控制台.但是,您可以在Web调试工具栏中查看转储的值(如果不使用工具栏,则可以在html中).