commit 331a2edf501a02cce69eebb8689019c86e6caf97
parent 0e0599394a47bc2fe5fa55135782694d0ed48629
Author: Henrique Chan Carvalho Machado <henriqueccmachado@tecnico.ulisboa.pt>
Date: Tue, 9 Dec 2025 12:04:27 +0100
oauth2_gateway: fix wrong log timezone
Diffstat:
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/oauth2_gateway/Cargo.toml b/oauth2_gateway/Cargo.toml
@@ -44,7 +44,7 @@ chrono = { version = "0.4.42", features = ["serde"] }
# Logging
tracing = "0.1.41"
-tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
+tracing-subscriber = { version = "0.3.20", features = ["env-filter", "local-time"] }
# Error handling
anyhow = "1.0.100"
diff --git a/oauth2_gateway/src/main.rs b/oauth2_gateway/src/main.rs
@@ -1,11 +1,13 @@
-use std::{fs, os::unix::fs::PermissionsExt};
-use oauth2_gateway::{config::Config, db, handlers, state::AppState};
+use anyhow::Result;
+use axum::{
+ Router,
+ routing::{get, post},
+};
use clap::Parser;
+use oauth2_gateway::{config::Config, db, handlers, state::AppState};
+use std::{fs, os::unix::fs::PermissionsExt};
use tower_http::trace::TraceLayer;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
-use anyhow::Result;
-use axum::{routing::{get, post}, Router,};
-
#[derive(Parser, Debug)]
#[command(version)]
@@ -15,7 +17,6 @@ struct Args {
config: String,
}
-
#[tokio::main]
async fn main() -> Result<()> {
// Init logging, tracing
@@ -24,7 +25,10 @@ async fn main() -> Result<()> {
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "oauth2_gateway=info,tower_http=info,sqlx=warn".into()),
)
- .with(tracing_subscriber::fmt::layer())
+ .with(
+ tracing_subscriber::fmt::layer()
+ .with_timer(tracing_subscriber::fmt::time::LocalTime::rfc_3339()),
+ )
.init();
let args = Args::parse();