Skip to content

2.10 docs are outdated, need a solution for logging a failing query. #9222

Discussion options

You must be logged in to vote

You're apparently working with DBAL 3 already. You are right, the documentation for logging, both in DBAL and ORM, is outdated and incomplete. DBAL 3.2 has introduced a new middleware for logging (see doctrine/dbal#4967) that basically allows you to plug in a PSR-3 logger.

When configuring your DBAL connection, instead of calling…

$config->setSQLLogger($someLegacySqlLogger);

… you call …

$config->setMiddlewares([
    new Doctrine\DBAL\Logging\Middleware($yourPsr3Logger)
])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@michaeldnelson
Comment options

Answer selected by michaeldnelson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants