From cc2fa54772c29f87ecc5eeeb8a03b23f70535518 Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Tue, 14 May 2024 12:30:18 -0400 Subject: [PATCH] HPCC-29334 Code review4 - Makes trace/span Id log columns optional - Updates README, provides sample Signed-off-by: Rodrigo Pastrana --- helm/examples/logging/README.md | 5 ++++- system/jlib/jlog.hpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/helm/examples/logging/README.md b/helm/examples/logging/README.md index 460ab4f7ab1..9d5d8e56817 100644 --- a/helm/examples/logging/README.md +++ b/helm/examples/logging/README.md @@ -96,7 +96,10 @@ Log output verbosity can be adjusted from "critical messages only" (1) up to "re The available log data columns include traceid(TRC), spanid(SPN), messageid(MID), audience(AUD), class(CLS), date(DAT), time(TIM), millitime(MLT), microtime(MCT), nanotime(NNT), processid(PID), threadid(TID), node(NOD), job(JOB), use(USE), session(SES), code(COD), component(COM), quotedmessage(QUO), prefix(PFX), all(ALL), and standard(STD). The log data columns (or fields) configuration is controlled by the `
`.logging.fields value, comprised of 3 letter codes delimited by the aggregation operator (+) or the removal operator (-). - For example, all component log output should include the standard columns except the job ID column: + Example: all component log output should include the standard columns except the job ID column: + helm install myhpcc ./hpcc --set global.logging.fields="STD-JOB" + + Example: Include trace and span info in addition to the standard columns: helm install myhpcc ./hpcc --set global.logging.fields="STD-JOB" Adjustment of per-component logging values can require assertion of multiple component specific values, which can be inconvinient to do via the --set command line parameter. In these cases, a custom values file could be used to set all required fields. diff --git a/system/jlib/jlog.hpp b/system/jlib/jlog.hpp index 88319e10850..322b58c444e 100644 --- a/system/jlib/jlog.hpp +++ b/system/jlib/jlog.hpp @@ -329,9 +329,9 @@ typedef enum #define MSGFIELD_LEGACY LogMsgField(MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix) #else #ifdef _CONTAINERIZED -#define MSGFIELD_STANDARD LogMsgField(MSGFIELD_span | MSGFIELD_trace | MSGFIELD_job | MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_class | MSGFIELD_audience) +#define MSGFIELD_STANDARD LogMsgField( MSGFIELD_job | MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_class | MSGFIELD_audience) #else -#define MSGFIELD_STANDARD LogMsgField(MSGFIELD_span | MSGFIELD_trace | MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix | MSGFIELD_audience) +#define MSGFIELD_STANDARD LogMsgField( MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix | MSGFIELD_audience) #endif #define MSGFIELD_LEGACY LogMsgField(MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix) #endif