Cover of the book Symfony 5: The Fast Track

Symfony 5: The Fast Track is the best book to learn modern Symfony development, from zero to production. +300 pages showcasing Symfony with Docker, APIs, queues & async tasks, Webpack, SPAs, etc.

Using Propel 1.4 detailed logging

Today Propel 1.4 was released and it contains some debugging goodies. We can use the DebugPDO class to get the nifty logging into the Web Debug Panel. However some more interesting information is turned off by default by Propel. It includes:

  • Time logging
    • Time spent for executing this query
  • Memory logging
    • Peak Usage during execution of the query
    • Total Memory usage after the query ran
    • Memory Delta caused by executing the query
  • Slow query logging
    • Duration after which a query is considered slow

Using this is very easy as of today / symfony 1.3 beta 2:

      classname: DebugPDO
        realmemoryusage: true
            enabled: true
            enabled: true
            threshold: 0.001
            enabled: true
            enabled: true
            enabled: true
            enabled: true
            enabled: true

The whole list can be found in the Propel Documentation. The prefix debugpdo.logging is taken care of by the key debug. Simply put the remaining path below it, creating a new nesting level each dot.

Because Propel takes the order into account, the above configuration results into something like this:

Propel 1.4 detailed logging
Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


"Time logging", "Memory logging", "Slow query logging"

Very good!
Awesome.Thats what I call a DB Debug Toolbar
Will doctrine 1.2 provide some functionality like this?
P.s. with symfony 1.2 + doctrine 1.1 there are just queries, even without execution time ..
I was looking for this for a long time! That's a really great tool for debuging/optimization
I thought propel was no longer supported on symfony.
I think Propel is a very good ORM.
Can we still use it for new project?

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.