Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework logger as a driver middleware #4941

Closed
morozov opened this issue Oct 30, 2021 · 2 comments · Fixed by #4967
Closed

Rework logger as a driver middleware #4941

morozov opened this issue Oct 30, 2021 · 2 comments · Fixed by #4967

Comments

@morozov
Copy link
Member

morozov commented Oct 30, 2021

The current SQLLogger has major disadvantages:

  1. It doesn't log exceptions (New Logger interface #3228) or anything else (Add query backtrace logger #3513) besides what's hard-coded in the wrapper connection.
  2. It's not extensible. Any addition to the interface would be a breaking change.
  3. It's not PSR-compliant.
  4. It's not a logger (Add query backtrace logger #3513 (comment)).

As of DBAL 3.0 (#4157), the Middleware interface is available which could be used to implement logging. It could log connecting, disconnecting, executing queries and prepared statements, numbers of fetched and affected rows, errors, and all other details that are available at the driver level API. The end-users will be able to extend it by implementing their own logging functionality without the need to change the API.

@morozov
Copy link
Member Author

morozov commented Nov 4, 2021

PoC: 3.2.x...morozov:issues/4941-logging-middleware. Need to change the way we identify drivers in the test suite.

@morozov morozov linked a pull request Nov 21, 2021 that will close this issue
3 tasks
@morozov morozov closed this as completed Nov 21, 2021
@morozov morozov added this to the 3.2.0 milestone Nov 21, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant