From 2b260abaf651208cb7267252eec8e2c9396242cf Mon Sep 17 00:00:00 2001
From: Tomasz Torcz <tomasz.torcz@airspace-intelligence.com>
Date: Thu, 13 Feb 2025 10:13:17 +0100
Subject: [PATCH] feat(chart): expose logging configuration

---
 charts/pgcat/templates/deployment.yaml | 5 +++++
 charts/pgcat/values.yaml               | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/charts/pgcat/templates/deployment.yaml b/charts/pgcat/templates/deployment.yaml
index 84c57f1b..1739da91 100644
--- a/charts/pgcat/templates/deployment.yaml
+++ b/charts/pgcat/templates/deployment.yaml
@@ -32,6 +32,11 @@ spec:
             {{- toYaml .Values.containerSecurityContext | nindent 12 }}
           image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
           imagePullPolicy: {{ .Values.image.pullPolicy }}
+          env:
+            - name: LOG_LEVEL
+              value: {{ .Values.configuration.general.log_level }}
+            - name: LOG_FORMAT
+              value: {{ .Values.configuration.general.log_format }}
           ports:
             - name: pgcat
               containerPort: {{ .Values.configuration.general.port }}
diff --git a/charts/pgcat/values.yaml b/charts/pgcat/values.yaml
index 3f933ca6..0f05d82d 100644
--- a/charts/pgcat/values.yaml
+++ b/charts/pgcat/values.yaml
@@ -199,6 +199,12 @@ configuration:
     # @param configuration.general.log_client_disconnections If we should log client disconnections
     log_client_disconnections: false
 
+    # @param configuration.general.log_level Default log level
+    log_level: "INFO"
+
+    # @param configuration.general.log_format Log format, possible values: text, structured, debug
+    log_format: "text"
+
     # TLS
     # tls_certificate: "server.cert"
     # tls_private_key: "server.key"