sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Emit INFO log events (and/or tracing spans) for DB migrations

Open karlmdavis opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. As a developer / ops-person, I find it surprising that sqlx doesn't emit any log events for migrations. Those are pretty important events in an app's lifecycle, and I think it's worth calling them out a bit in the logs.

Describe the solution you'd like Emit sqlx::migration log events at INFO level when migrations are about to be performed and when all migrations are complete. Also consider adding DEBUG events in the same category with further detail.

Describe alternatives you've considered Right now, the only way to get information on migrations is to enable DEBUG for all sqlx::query events, which is pretty chatty for most applications, and still doesn't really provide a way to easily find these important DB migration events, specifically.

Additional context N/A

karlmdavis avatar Feb 02 '24 03:02 karlmdavis