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:
co-authored by
github_username <github_email>
Claude Opus 4.6
parent
41fd53fe37
commit
e58391dd7d
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user