Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.75k stars 106 forks source link

PrismaClient set log level #428

Closed jareducherek closed 5 months ago

jareducherek commented 5 months ago

I spent ~20 mins scanning the documentation and code, but could not figure out how to pass any parameters to PrismaClient::build in order to set the log level.

I want to remove INFO from the log level for my client as it is spamming my logs.

https://www.prisma.io/docs/orm/prisma-client/observability-and-logging/logging

Brendonovich commented 5 months ago

I assume you're using the tracing ecosystem for your logs, in which case PCR doesn't have any logs of its own. You'll need to setup a filter yourself with something like EnvFilter.

jareducherek commented 5 months ago

@Brendonovich Thanks for the pointer. This is working. Ultimately I am using EnvFilter::new("crate_name=info,other=warn") to filter out the queries from the PrismaClient.