user1262516
user1262516

Reputation:

Doctrine profiling in Symfony 2.8

I've read a lot of the Q&A already on here for this, as well as the Symfony docs, but I'm no further forward. I have an API that I want to see profiling data for Doctrine for. Using app_dev.php with Debug::enable();

config.yml doctrine: dbal: ...cut profiling: true

I can see the requests coming in to the profiler. The Doctrine 'tab' is greyed out and shows 0 across the board - queries, statements, query time, etc...

I have added a listener on kernel.response that adds doctrine queries to the response to prove there are things happening (nevermind that data is shown from the database in the response, ruling out caches).

I'm clearly missing something obvious. I just can't see what it is.

Upvotes: 2

Views: 2010

Answers (2)

Alain
Alain

Reputation: 36954

In Symfony4+, you need to enable doctrine profiling:

# config/packages/dev/doctrine.yaml
doctrine:
  dbal:
    profiling: true

Upvotes: 2

user1262516
user1262516

Reputation:

I had overridden Doctrine's logger in my Bundle using ->setSQLLogger(new \Doctrine\DBAL\Logging\DebugStack);

Removing this corrects this error.

Upvotes: 0

Related Questions