Skip to content

Commit 0ed022d

Browse files
authored
[FIL-807] Log detailed reason for 5xx server errors (#273)
* Log detailed reason for 5xx server errors * Disable info logs for sqlx
1 parent eee8401 commit 0ed022d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

fplus-http-server/src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use fplus_lib::core::allocator::update_installation_ids_logic;
2-
use log::info;
32
mod middleware;
43
use middleware::verifier_auth::VerifierAuth;
54
pub(crate) mod router;
6-
use std::env;
75

86
use actix_web::{
97
middleware::{Compress, Logger},
@@ -47,10 +45,7 @@ where
4745
#[tokio::main]
4846
async fn main() -> std::io::Result<()> {
4947
dotenv::dotenv().ok();
50-
let log_level = env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string());
51-
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
52-
info!("Logger initialized at log level: {}", log_level);
53-
48+
env_logger::init();
5449
if let Err(e) = fplus_database::setup().await {
5550
panic!("Failed to setup database connection: {}", e);
5651
}

fplus-lib/src/config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ pub fn default_env_vars() -> &'static HashMap<&'static str, &'static str> {
1010
m.insert("GITHUB_REPO", "filecoin-plus-falcon");
1111
m.insert("GITHUB_APP_ID", "826129");
1212
m.insert("GITHUB_INSTALLATION_ID", "48299904");
13-
m.insert("RUST_LOG", "info");
13+
m.insert(
14+
"RUST_LOG",
15+
"info,actix_web::middleware::logger=debug,sqlx::query=warn",
16+
);
1417
m.insert("RUST_BACKTRACE", "1");
1518
m.insert("DB_URL", "");
1619
m.insert("ALLOCATOR_GOVERNANCE_OWNER", "fidlabs");

0 commit comments

Comments
 (0)