refactor(log): Use CLEF for JSON logs
Use Compact Log Event Format (CLEF) for JSON logs along with custom properties.
This commit is contained in:
@@ -131,7 +131,7 @@ writeJsonLog() {
|
||||
--arg message "$1" \
|
||||
--arg operation "${4:-UNSPECIFIED}" \
|
||||
--arg code "${5:-0}" \
|
||||
'{"timestamp":$timestamp, "hostname":$hostname, "programName":$pName, "pid":$pid, "level":$level, "status":$status, "message":$message, "operation":$operation, "code":$code}' \
|
||||
'{"@t":$timestamp, "@m":$message, "@l":$level, "hostname":$hostname, "programName":$pName, "pid":$pid, "status":$status, "operation":$operation, "code":$code}' \
|
||||
)"
|
||||
|
||||
printf "%s\n" "$JSON_PROPS" >>"$logFile"
|
||||
|
||||
Reference in New Issue
Block a user