From 88bcaade5cc9613ccde2b5ee98a0b321a55aa1d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:53:26 +0000 Subject: [PATCH 1/3] Initial plan From 105e96d3f59d7c857fe1289136756264fe3dbf21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:55:45 +0000 Subject: [PATCH 2/3] Add stream logs configuration to values.yaml and configmap template Co-authored-by: SkyeYoung <48400568+SkyeYoung@users.noreply.github.com> --- charts/gateway/templates/configmap.yaml | 7 +++++++ charts/gateway/values.yaml | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/charts/gateway/templates/configmap.yaml b/charts/gateway/templates/configmap.yaml index b1fa65f..5cb0fec 100644 --- a/charts/gateway/templates/configmap.yaml +++ b/charts/gateway/templates/configmap.yaml @@ -186,6 +186,13 @@ data: lua_shared_dict: {{- toYaml .Values.apisix.stream.luaSharedDict | nindent 10 }} {{- end }} + enable_access_log: {{ .Values.logs.stream.enableAccessLog }} + {{- if .Values.logs.stream.enableAccessLog }} + access_log: "{{ .Values.logs.stream.accessLog }}" + access_log_format: >- + {{- .Values.logs.stream.accessLogFormat | nindent 10 }} + access_log_format_escape: {{ .Values.logs.stream.accessLogFormatEscape }} + {{- end }} http: {{- if and (.Values.deployment.fallback_cp) (eq .Values.deployment.fallback_cp.mode "write") }} enable_access_log: false diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index 24bc96d..52a3f1d 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -510,6 +510,16 @@ logs: errorLog: "/dev/stderr" # -- Error log level, Allowed values: `debug`, `info`, `notice`, `warn`, `error`, `crit`, `alert`, `or` `emerg` errorLogLevel: "warn" + # -- Stream access log and error log configuration + stream: + # -- Enable stream access log or not, default false + enableAccessLog: false + # -- Stream access log path + accessLog: "logs/access_stream.log" + # -- Stream access log format + accessLogFormat: '$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time $apisix_request_id' + # -- Allows setting json or default characters escaping in variables for stream + accessLogFormatEscape: default dns: resolvers: From aefa4a1ba54033fab19de139d70dfdd6d23576b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:08:08 +0000 Subject: [PATCH 3/3] Add fallback_cp conditional for stream logs, bump chart version, and regenerate docs Co-authored-by: SkyeYoung <48400568+SkyeYoung@users.noreply.github.com> --- charts/gateway/Chart.yaml | 2 +- charts/gateway/README.md | 5 +++++ charts/gateway/templates/configmap.yaml | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/gateway/Chart.yaml b/charts/gateway/Chart.yaml index 8a39cf3..60fca83 100644 --- a/charts/gateway/Chart.yaml +++ b/charts/gateway/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.50 +version: 0.2.51 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/gateway/README.md b/charts/gateway/README.md index e28b9e8..cd79db0 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -209,6 +209,11 @@ The command removes all the Kubernetes components associated with the chart and | logs.enableAccessLog | bool | `true` | Enable access log or not, default true | | logs.errorLog | string | `"/dev/stderr"` | Error log path | | logs.errorLogLevel | string | `"warn"` | Error log level, Allowed values: `debug`, `info`, `notice`, `warn`, `error`, `crit`, `alert`, `or` `emerg` | +| logs.stream | object | `{"accessLog":"logs/access_stream.log","accessLogFormat":"$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time $apisix_request_id","accessLogFormatEscape":"default","enableAccessLog":false}` | Stream access log and error log configuration | +| logs.stream.accessLog | string | `"logs/access_stream.log"` | Stream access log path | +| logs.stream.accessLogFormat | string | `"$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time $apisix_request_id"` | Stream access log format | +| logs.stream.accessLogFormatEscape | string | `"default"` | Allows setting json or default characters escaping in variables for stream | +| logs.stream.enableAccessLog | bool | `false` | Enable stream access log or not, default false | | nameOverride | string | `""` | | | nginx.enableCPUAffinity | bool | `true` | | | nginx.envs | list | `[]` | | diff --git a/charts/gateway/templates/configmap.yaml b/charts/gateway/templates/configmap.yaml index 5cb0fec..deeb1f2 100644 --- a/charts/gateway/templates/configmap.yaml +++ b/charts/gateway/templates/configmap.yaml @@ -186,7 +186,11 @@ data: lua_shared_dict: {{- toYaml .Values.apisix.stream.luaSharedDict | nindent 10 }} {{- end }} + {{- if and (.Values.deployment.fallback_cp) (eq .Values.deployment.fallback_cp.mode "write") }} + enable_access_log: false + {{- else }} enable_access_log: {{ .Values.logs.stream.enableAccessLog }} + {{- end }} {{- if .Values.logs.stream.enableAccessLog }} access_log: "{{ .Values.logs.stream.accessLog }}" access_log_format: >-