From e22afb6e953bd8ab8acaa6ebbc04d72c50cd6fb2 Mon Sep 17 00:00:00 2001 From: Trung Thai Date: Mon, 18 Nov 2019 10:30:25 -0500 Subject: [PATCH] Add log_level attribute in the Chart to allow overwrite of default Provide the ability to overwrite the default logging level. Use 'info' as the default with log_level attribute. Change-Id: I4bfd82a568c1eaad7de891bd103b3f8ff032e589 --- charts/maas/templates/etc/_rsyslog.conf.tpl | 6 ++++++ charts/maas/values.yaml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/charts/maas/templates/etc/_rsyslog.conf.tpl b/charts/maas/templates/etc/_rsyslog.conf.tpl index 6affd3b..37bd367 100644 --- a/charts/maas/templates/etc/_rsyslog.conf.tpl +++ b/charts/maas/templates/etc/_rsyslog.conf.tpl @@ -5,6 +5,12 @@ $UDPServerRun {{ tuple "maas_region" "podport" "region_syslog" . | include "helm # Reduce message repetition $RepeatedMsgReduction on + +# Overwrite default when log_level is set +{{- if .Values.conf.syslog.log_level }} +*.{{ .Values.conf.syslog.log_level }} {{ .Values.conf.syslog.logpath }}/{{ .Values.conf.syslog.logfile }} +{{- end }} + ##$RepeatedMsgContainsOriginalMsg on :fromhost-ip, !isequal, "127.0.0.1" {{ .Values.conf.syslog.logpath }}/{{ .Values.conf.syslog.logfile }} diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml index 995875d..4ab4c3d 100644 --- a/charts/maas/values.yaml +++ b/charts/maas/values.yaml @@ -195,6 +195,9 @@ conf: rotate: '30' # Size threshold when a log should rotate size: '100M' + # levels (emerg,alert,crit,error,warning,notice,info,debug) + # use 'info' as default when overwritting the default + log_level: 'info' maas: override: append: