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 b1fa65f..deeb1f2 100644 --- a/charts/gateway/templates/configmap.yaml +++ b/charts/gateway/templates/configmap.yaml @@ -186,6 +186,17 @@ 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: >- + {{- .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: