diff --git a/apps/web/src/utils/logger.ts b/apps/web/src/utils/logger.ts index 00a172364..546951ef6 100644 --- a/apps/web/src/utils/logger.ts +++ b/apps/web/src/utils/logger.ts @@ -1,7 +1,8 @@ /** - * FIX #18, #19, #22: Logger structuré pour le frontend + * FIX #18, #19, #22, #25: Logger structuré pour le frontend * - Support de la corrélation avec request_id - * - Logs structurés en JSON en production + * - Logs structurés en JSON en production (FIX #25: Standardisé) + * - Format texte en développement pour lisibilité * - Filtrage selon l'environnement */ @@ -67,8 +68,9 @@ function formatLog( const logContext = { ...globalContext, ...context }; const timestamp = new Date().toISOString(); + // FIX #25: Standardiser sur JSON en production pour faciliter l'agrégation if (isProd) { - // En production : JSON structuré + // En production : JSON structuré (standardisé pour agrégation) const logEntry = { timestamp, level, diff --git a/veza-common/src/logging.rs b/veza-common/src/logging.rs index ff8a5ee43..3f8e61b07 100644 --- a/veza-common/src/logging.rs +++ b/veza-common/src/logging.rs @@ -88,6 +88,7 @@ pub fn init_with_config(config: LoggingConfig) -> VezaResult<()> { let env_filter = EnvFilter::try_from_default_env() .unwrap_or_else(|_| EnvFilter::new(&log_level)); + // FIX #25: Standardiser sur JSON en production/staging, texte en développement // Create formatting layer based on format let fmt_layer = match config.format.as_str() { "json" => fmt::layer()