Change database log level to debug

This commit is contained in:
GW_MC
2025-11-25 21:17:03 +08:00
parent f9218e0927
commit 56c1161e97
4 changed files with 16 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.47.0", features = ["full"] }
sea-orm = { version = "2.0.0-rc", features = [ "sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio-rustls", "macros", "mock", "with-chrono", "with-json", "with-uuid", "sqlite-use-returning-for-3_35", "mariadb-use-returning" ] }
log = "0.4.28"
[lints]
workspace = true

View File

@@ -1,3 +1,4 @@
use log::LevelFilter;
pub use sea_orm::ConnectOptions;
pub mod generated;
@@ -13,7 +14,8 @@ pub async fn get_connection<T: FnOnce(&mut ConnectOptions)>(
.connect_timeout(std::time::Duration::from_secs(8))
.idle_timeout(std::time::Duration::from_secs(8))
.test_before_acquire(true)
.sqlx_logging(true);
.sqlx_logging(true)
.sqlx_logging_level(LevelFilter::Debug);
if let Some(option_fn) = option_fn {
option_fn(&mut opt);