From fdb746d6db75201e422585f8752be03cd962f339 Mon Sep 17 00:00:00 2001 From: "hoang.le" Date: Wed, 29 May 2024 07:49:38 -0700 Subject: [PATCH] Add LogLevel section --- tools/config/update-configmap.sh | 73 ++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/tools/config/update-configmap.sh b/tools/config/update-configmap.sh index 14bbef16..dc658169 100644 --- a/tools/config/update-configmap.sh +++ b/tools/config/update-configmap.sh @@ -22,37 +22,43 @@ echo Generating D365 Configuration D365_LOG_LEVEL=$(cat << JSON { - "Default": "Error", - "OFM.Portal.ProviderProfile": "Error", - "OFM.D365.Process": "Error", - "OFM.D365.Batch": "Error", - "Microsoft.AspNetCore": "Error" + "LogLevel": { + "Default": "Error", + "OFM.Portal.ProviderProfile": "Error", + "OFM.D365.Process": "Error", + "OFM.D365.Batch": "Error", + "Microsoft.AspNetCore": "Error" + }, + "Console": { + "FormatterName": "simple", + "FormatterOptions": { + "SingleLine": true, + "IncludeScopes": true, + "TimestampFormat": "yyyy-MM-ddTHH:mm:ss", + "UseUtcTimestamp": false, + "JsonWriterOptions": { + "Indented": true + } + } + }, + "Debug": { + "LogLevel": { + "Default": "Critical" + } + } } JSON ) if [ "$ENV_VAL" = "dev" ]; then D365_LOG_LEVEL=$(cat << JSON { - "Default": "Warning", - "OFM.Portal.ProviderProfile": "Error", - "OFM.D365.Process": "Warning", - "OFM.D365.Batch": "Warning", - "Microsoft.AspNetCore": "Warning" -} -JSON -) -fi -readonly D365_LOG_LEVEL - -D365_EMAIL_SAFE_LIST_ENABLE=true -if [ "$ENV_VAL" = "prod" ]; then - D365_EMAIL_SAFE_LIST_ENABLE=false -fi -readonly D365_EMAIL_SAFE_LIST_ENABLE - -D365_CONFIGURATION=$(jq << JSON -{ - "Logging": $D365_LOG_LEVEL, + "LogLevel": { + "Default": "Warning", + "OFM.Portal.ProviderProfile": "Error", + "OFM.D365.Process": "Warning", + "OFM.D365.Batch": "Warning", + "Microsoft.AspNetCore": "Warning" + }, "Console": { "FormatterName": "simple", "FormatterOptions": { @@ -69,7 +75,22 @@ D365_CONFIGURATION=$(jq << JSON "LogLevel": { "Default": "Critical" } - }, + } +} +JSON +) +fi +readonly D365_LOG_LEVEL + +D365_EMAIL_SAFE_LIST_ENABLE=true +if [ "$ENV_VAL" = "prod" ]; then + D365_EMAIL_SAFE_LIST_ENABLE=false +fi +readonly D365_EMAIL_SAFE_LIST_ENABLE + +D365_CONFIGURATION=$(jq << JSON +{ + "Logging": $D365_LOG_LEVEL, "AllowedHosts": "*", "AppSettings": { "PageSize": 50,