Skip to content

4.9.0 - Actually support query logging

Latest
Compare
Choose a tag to compare
@penny-for-vapor penny-for-vapor released this 29 May 18:20
ac03d7c

What's Changed

Actually support query logging by @gwynne in #326

Now supports query logging with the same semantics as the other drivers. When a query is executed with query logging enabled at or above the logger’s current log level, the actual SQL query and its accompanying array of bound parameters (if any) are logged as structured metadata on the logger using a generic message. This follows the recommended guidelines for logging in libraries. Credit goes to @MahdiBM for the original suggestion.

Before:

2024-05-29T00:00:00Z debug codes.vapor.fluent : database-id=mysql [MySQLKit] SELECT * FROM foo WHERE a=? [["bar"]]

After:

2024-05-29T00:00:00Z debug codes.vapor.fluent : database-id=mysql sql=SELECT * FROM foo WHERE a=? binds=["bar"] [MySQLKit] Executing query
This patch was released by @gwynne

Full Changelog: 4.8.0...4.9.0