Bicu
Bicu

Reputation: 507

symfony2 webprofiler show prod environment

The system in the dev environment going very slow with jquery but in prod me very well, could put the webprofiler in the prod environment? greetings and thanks

Upvotes: 5

Views: 5775

Answers (1)

Nick Stemerdink
Nick Stemerdink

Reputation: 1067

Add this to routing.yml:

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

Add this to config_prod.yml:

web_profiler:
    toolbar: true

Change this in AppKernel.php:

Remove $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle() from this statement:

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    // ...
}

and add this to the bundles array outside of the if statement:

new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle()

In app.php set debug=true

$kernel = new AppKernel('prod', true);

In config_prod.yml add:

framework:
    profiler:
        only_exceptions: false

That should do the trick.

Don't forgot to execute this after making the code changes:

$ php ./app/console cache:clear --env=prod --no-debug

Upvotes: 16

Related Questions