mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Outdated doc #6941
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nimasdj on GitHub (Mar 3, 2022).
Bug Report
Documentation is outdated here: https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/reference/advanced-configuration.html#sql-logger-optional as EchoSQLLogger doesn't exist anymore in latest version. which class should I use?
@greg0ire commented on GitHub (Mar 3, 2022):
In fact, the
SQLLoggerinterface itself is deprecated in favor of using a logging middleware@nimasdj commented on GitHub (Mar 3, 2022):
Could you please provide a sample code line how to use this middleware instead of EchoSQLLoger?
@greg0ire commented on GitHub (Mar 3, 2022):
Sure!
EDIT: actually this is wrong, changing the middlewares at runtime has no effect.
@nimasdj commented on GitHub (Mar 4, 2022):
How can I use simple print instead of psr/log?
@greg0ire commented on GitHub (Mar 4, 2022):
You can't, but you can extend https://github.com/php-fig/log/blob/master/src/AbstractLogger.php and implement
log()with "simple print".@raziel057 commented on GitHub (Apr 25, 2022):
@greg0ire While I was trying to fix a deprecation by replacing the usage of SQLLogger by a Logging Middleware in a Symfony command, I encountered an issue related here https://github.com/symfony/symfony/issues/46158
Can you please advice on the way to proceed. Or maybe you should allow to replace a the logger in the connection decorator created by the middleware?
@greg0ire commented on GitHub (Apr 25, 2022):
I think you should open a feature request on
doctrine/dbalclearly explaining why you need the logger to be different in some contexts.@nimasdj commented on GitHub (Jul 4, 2022):
If I want to use https://github.com/php-fig/log/blob/master/src/AbstractLogger.php as you gave it in your sample code, do I need to have "use" line for this AbstractLogger.php? If yes, how should this "use" line be?
@greg0ire commented on GitHub (Jul 4, 2022):
@nimasdj
use Psr\Log\AbstractLogger;@nimasdj commented on GitHub (Aug 9, 2024):
@greg0ire What is exactly wrong in your code above as you mentioned in "edit" area? How to improve the wrong thing you said?
@greg0ire commented on GitHub (Aug 9, 2024):
It's too late, and I'm not only talking about your answer, which is 2 years late. I mean calling
setMiddlewares()here is too late, the connection has already been built.@nimasdj commented on GitHub (Aug 9, 2024):
@greg0ire So how the code should be to fix it?