diff --git a/stable/semaphore/templates/configmap.yaml b/stable/semaphore/templates/configmap.yaml index 6d8efe2..b46aff2 100644 --- a/stable/semaphore/templates/configmap.yaml +++ b/stable/semaphore/templates/configmap.yaml @@ -49,6 +49,62 @@ data: {{- range $index, $val := .Values.config.forwarded_env_vars }} {{- if $index }}, {{ end }}"{{ $val }}" {{- end }}] + {{- $first = false }} + {{- end }} + + {{- if or .Values.logging.eventLog.enabled .Values.logging.taskLog.enabled }} + {{- if not $first }},{{ end }} + "log": { + {{- $logFirst := true }} + {{- if .Values.logging.eventLog.enabled }} + "events": { + "enabled": {{ .Values.logging.eventLog.enabled }}, + {{- if .Values.logging.eventLog.format }} + "format": "{{ .Values.logging.eventLog.format }}", + {{- end }} + "logger": { + "filename": "{{ .Values.logging.eventLog.logger.filename }}", + "maxsize": {{ .Values.logging.eventLog.logger.maxsize }}, + "maxage": {{ .Values.logging.eventLog.logger.maxage }}, + "maxbackups": {{ .Values.logging.eventLog.logger.maxbackups }}, + "compress": {{ .Values.logging.eventLog.logger.compress }} + } + } + {{- $logFirst = false }} + {{- end }} + {{- if .Values.logging.taskLog.enabled }} + {{- if not $logFirst }},{{ end }} + "tasks": { + "enabled": {{ .Values.logging.taskLog.enabled }}, + {{- if .Values.logging.taskLog.format }} + "format": "{{ .Values.logging.taskLog.format }}", + {{- end }} + "logger": { + "filename": "{{ .Values.logging.taskLog.logger.filename }}", + "maxsize": {{ .Values.logging.taskLog.logger.maxsize }}, + "maxage": {{ .Values.logging.taskLog.logger.maxage }}, + "maxbackups": {{ .Values.logging.taskLog.logger.maxbackups }}, + "compress": {{ .Values.logging.taskLog.logger.compress }} + } + {{- if .Values.logging.taskResultLogger.filename }} + , + "result_logger": { + "filename": "{{ .Values.logging.taskResultLogger.filename }}", + "maxsize": {{ .Values.logging.taskResultLogger.maxsize }}, + "maxage": {{ .Values.logging.taskResultLogger.maxage }}, + "maxbackups": {{ .Values.logging.taskResultLogger.maxbackups }}, + "compress": {{ .Values.logging.taskResultLogger.compress }} + } + {{- end }} + } + {{- end }} + } + {{- $first = false }} + {{- end }} + + {{- if .Values.general.maxTasksPerTemplate }} + {{- if not $first }},{{ end }} + "max_tasks_per_template": {{ .Values.general.maxTasksPerTemplate }} {{- end }} } diff --git a/stable/semaphore/values.yaml b/stable/semaphore/values.yaml index 75c4e69..8a3530c 100644 --- a/stable/semaphore/values.yaml +++ b/stable/semaphore/values.yaml @@ -481,4 +481,60 @@ postgresql: # -- Enable service monitor for postgresql enabled: false +# Logging configuration (PRO feature 2.10+) +# Reference: https://docs.semaphoreui.com/administration-guide/logs/#logger-options +logging: + # Event/Activity log configuration + eventLog: + # -- Enable event logging + enabled: false + # -- Log format (json or text) + format: "json" + logger: + # -- Log file path + filename: "/var/log/semaphore/events.log" + # -- Maximum size in megabytes before rotation + maxsize: 100 + # -- Maximum number of days to retain old log files + maxage: 90 + # -- Maximum number of old log files to retain + maxbackups: 10 + # -- Compress rotated log files + compress: true + + # Task execution log configuration + taskLog: + # -- Enable task logging + enabled: false + # -- Log format (json or text) + format: "json" + logger: + # -- Log file path + filename: "/var/log/semaphore/tasks.log" + # -- Maximum size in megabytes before rotation + maxsize: 100 + # -- Maximum number of days to retain old log files + maxage: 90 + # -- Maximum number of old log files to retain + maxbackups: 10 + # -- Compress rotated log files + compress: true + + # Task results log configuration + taskResultLogger: + # -- Log file path (set to enable task result logging) + filename: "" + # -- Maximum size in megabytes before rotation + maxsize: 100 + # -- Maximum number of days to retain old log files + maxage: 90 + # -- Maximum number of old log files to retain + maxbackups: 10 + # -- Compress rotated log files + compress: true + +general: + # -- Maximum tasks to retain per template (0 = unlimited) + maxTasksPerTemplate: 0 + ...