Symfony:在"prod"中显示开发工具栏.环境 [英] Symfony: Showing the dev toolbar in "prod" environment
问题描述
我设法通过以下方式为用户会话以交互方式将symfony应用程序的调试模式设置为开"和关":
I managed to interactively set the debugging mode of my symfony application On and Off for a user session with something like this:
$configuration = ProjectConfiguration::getApplicationConfiguration($app,
$env, $debugging);
我知道显示或不显示Web调试工具栏并不取决于$ debugging的值,而是取决于当前环境的配置.
I know that the Web Debug Toolbar showing up or not does not depend on the value of $debugging, but the configuration of the current environment.
目前,工具栏出现的唯一方式是当$ env ='dev'时.
To this moment the only way that the toolbar appears is when $env = 'dev'.
我也想在访问产品"环境时将其激活.
I'd like to activate it when accessing the "prod" environment also.
我有此应用设置:
prod:
.settings:
no_script_name: true
logging_enabled: false
web_debug: true
error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
web_debug: true
cache: false
no_script_name: false
etag: false
该工具栏未显示,显然忽略了"web_debug"设置.
The toolbar is not being shown, apparently ignoring the "web_debug" setting.
如果我回显(sfConfig :: get('sf_web_debug')),我会得到"true".
If I echo(sfConfig::get('sf_web_debug')) I get "true".
¿我如何使工具栏正常工作?
¿How could I get the toolbar working?
推荐答案
您还需要更改factory.yml.默认情况下,产品"环境中没有Logger.
you also need to change the factory.yml . By default, there's no Logger in the 'prod'-environment.
只是这样注释掉:
prod:
# logger:
# class: sfNoLogger
# param:
# level: err
# loggers: ~
这篇关于Symfony:在"prod"中显示开发工具栏.环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!