DamienHarper / auditor

auditor, the missing audit log library
MIT License
164 stars 53 forks source link

Deprecation of Doctrine\DBAL\Logging\SQLLogger Interface #113

Closed fkropfhamer closed 2 years ago

fkropfhamer commented 2 years ago
Q A
auditor version 2.0.3
PHP version 8.1.8
Database SQLite

Summary

The Doctrine\DBAL\Logging\SQLLogger Interface is deprecated

Current behavior

Symfony 6.1 shows a deprecation notice.

2022-07-12T09:45:13+00:00 [info] User Deprecated: The "DH\Auditor\Provider\Doctrine\Auditing\Logger\Logger" class implements "Doctrine\DBAL\Logging\SQLLogger" that is deprecated Use {@see \Doctrine\DBAL\Logging\Middleware} or implement {@see \Doctrine\DBAL\Driver\Middleware} instead.
2022-07-12T09:45:13+00:00 [info] User Deprecated: The "DH\Auditor\Provider\Doctrine\Auditing\Logger\LoggerChain" class implements "Doctrine\DBAL\Logging\SQLLogger" that is deprecated Use {@see \Doctrine\DBAL\Logging\Middleware} or implement {@see \Doctrine\DBAL\Driver\Middleware} instead.

How to reproduce

  1. Install the auditor bundle in symfony 6.1
  2. configure SQLite database
  3. Look at deprecations.

Expected behavior

No deprecations are shown when using the library.

dmitryuk commented 2 years ago

I've tried to implement Middleware way, but:

  1. can't do it in DoctrineSubscriber, because Connection already established
  2. Middleware can be added only before connection created
  3. we need to create CompilerPass, where will add additional Middleware to Connection So work still in progress...
DamienHarper commented 2 years ago

fixed in master branch (thanks @dmitryuk)

dmitryuk commented 2 years ago

@DamienHarper Issue still not closed, please reopen it. I'm cooking a new MR to auditor-bundle to finish it.