Add --json-log flag to enable structured JSON logging (#19968)

Co-authored-by: github_username <github_email>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Lee
2026-03-05 11:24:12 -08:00
committed by GitHub
co-authored by github_username <github_email> Claude Opus 4.6
parent 41fd53fe37
commit e58391dd7d
4 changed files with 18 additions and 1 deletions
+2 -1
View File
@@ -533,6 +533,7 @@ pub struct ServerConfig {
pub max_payload_size: usize,
pub log_dir: Option<String>,
pub log_level: Option<String>,
pub json_log: bool,
pub service_discovery_config: Option<ServiceDiscoveryConfig>,
pub prometheus_config: Option<PrometheusConfig>,
pub request_timeout_secs: u64,
@@ -722,7 +723,7 @@ pub async fn startup(config: ServerConfig) -> Result<(), Box<dyn std::error::Err
}
})
.unwrap_or(Level::INFO),
json_format: false,
json_format: config.json_log,
log_dir: config.log_dir.clone(),
colorize: true,
log_file_name: "smg".to_string(),