Skip to content

Unable to log queries even though .log_statements(LevelFilter::Trace) is used? #3777

Answered by abonander
pongloongyeat asked this question in Q&A
Discussion options

You must be logged in to vote

That just enables emission of tracing and log records at TRACE level. You need to set RUST_LOG=sqlx::query=trace to actually get the logs.

Using LevelFilter may have been a misstep in API design, since it's not actually being used as a filter here. We chose it instead of Level because it also has an Off level, but that may have been more intuitive to model as Option<Level> instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pongloongyeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants