在开发环境中运行Symfony应用程序时,Web调试工具栏允许我查看Doctrine生成的查询数.Console命令是否有类似的探查器选项?
小智 5
如文档中所述,探查器仅收集所有请求的信息.我相信控制台命令没有收集器.深入了解Doctrine执行的查询的方法之一是检查日志文件.例如,您可以在基于Unix的系统上执行以下操作:
tail -f app/logs/dev.log | grep doctrine
Run Code Online (Sandbox Code Playgroud)
另请参阅:http://symfony.com/doc/current/book/internals.html#profiler
是的,--verbose正如@manolo 提到的那样很有用。您可以控制-v -vv -vvv从 Monolog 处理程序配置中获取输出的内容
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: INFO
VERBOSITY_VERY_VERBOSE: DEBUG
channels: ["!doctrine"]
console_very_verbose:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: NOTICE
VERBOSITY_VERY_VERBOSE: NOTICE
VERBOSITY_DEBUG: DEBUG
channels: ["doctrine"]
Run Code Online (Sandbox Code Playgroud)
请注意您甚至可以禁用通道-v或--verbose仅在指定的详细级别输出非学说日志。
| 归档时间: |
|
| 查看次数: |
6812 次 |
| 最近记录: |