[LOGGING] Fix #25: Standardisation formats logs - JSON en prod/staging, console/texte en dev - Documenté et confirmé
This commit is contained in:
parent
e0e76c1f49
commit
524a35ce51
2 changed files with 6 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue