Skip to content

Commit 04f02c1

Browse files
janhoygerlowskija
andauthored
Configure operator logging in helm chart (#779)
Co-authored-by: Jason Gerlowski <gerlowskija@apache.org>
1 parent 38b56b8 commit 04f02c1

File tree

6 files changed

+54
-1
lines changed

6 files changed

+54
-1
lines changed

docs/running-the-operator.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,18 @@ The final image will only contain the solr-operator binary and necessary License
148148
* **--health-probe-bind-address=** The address to bind the health probe servlet on.
149149
If only a port is provided (e.g. `:8081`), then the metrics server will respond to requests with any Host header.
150150
(defaults to _:8081_)
151-
151+
152+
* **--zap-devel** Enables development mode.
153+
Changes logging to `console` encoder and `debug` level. (_true_ | _false_, defaults to _false_)
154+
155+
* **--zap-log-level** Overrides the log level.
156+
Can be one of `debug`, `info`, `error`, or any integer value > 0 for custom verbosity. (_string_, defaults to _empty_)
157+
158+
* **--zap-encoder** Overrides the log format.
159+
Use `console` or `json`. (_string_, defaults to _empty_)
160+
161+
* **--zap-stacktrace-level** Overrides the level for stack trace logging. (_string_, defaults to _empty_)
162+
152163
## Client Auth for mTLS-enabled Solr clusters
153164

154165
For SolrCloud instances that run with mTLS enabled (see `spec.solrTLS.clientAuth`), the operator needs to supply a trusted certificate when making API calls to the Solr pods it is managing.

docs/upgrade-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl
125125

126126
## Upgrade Warnings and Notes
127127

128+
### v0.10.0
129+
- **Logging now defaults to JSON format**
130+
The new default for CLI flag `--zap-devel` is now `false`, causing log encoding to be `json` and log level to be `info`.
131+
There is a new helm value `development` that can be set to `true` to switch to `console` encoding and `debug` level
132+
that was the default in previous versions.
133+
128134
### v0.8.0
129135
- **The minimum supported Solr version is now 8.11**
130136
If you are unable to use a newer version of Solr, please install the `v0.7.1` version of the Solr Operator.

helm/solr-operator/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ annotations:
6060
links:
6161
- name: Github PR
6262
url: https://github.com/apache/solr-operator/pull/774
63+
- kind: changed
64+
description: The default logging format is now `json`, and default log level is `info`.
65+
links:
66+
- name: Github PR
67+
url: https://github.com/apache/solr-operator/pull/779
68+
- kind: added
69+
description: Ability to configure `development` mode as well as log encoder, log level and stacktrace log level
70+
links:
71+
- name: Github Issue
72+
url: https://github.com/apache/solr-operator/issues/778
73+
- name: Github PR
74+
url: https://github.com/apache/solr-operator/pull/779
6375
artifacthub.io/images: |
6476
- name: solr-operator
6577
image: apache/solr-operator:v0.10.0-prerelease

helm/solr-operator/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ The command removes all the Kubernetes components associated with the chart and
191191
| tolerations | []object | | Specify a list of Kubernetes tolerations for the Solr Operator pod |
192192
| priorityClassName | string | `""` | Give a priorityClassName for the Solr Operator pod |
193193
| sidecarContainers | []object | | An optional list of additional containers to run along side the Solr Operator in its pod |
194+
| logger.level | string | | Overrides the log level. Can be one of `debug`, `info`, `error`, or any integer value > 0 which corresponds to custom debug levels of increasing verbosity|
195+
| logger.encoder | string | | Overrides the log format. Use `console` or `json`. |
196+
| logger.stacktraceLevel | string | | Overrides the level for stackTrace logging. |
197+
| development | boolean | `false` | Enables development mode. This will change logging to `console` encoder and `debug` level |
194198

195199
### Configuring the Zookeeper Operator
196200

helm/solr-operator/templates/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ spec:
7878
{{- else }}
7979
- "--leader-elect=false"
8080
{{- end }}
81+
- --zap-devel={{ .Values.development }}
82+
{{- if .Values.logger.encoder }}
83+
- --zap-encoder={{ .Values.logger.encoder }}
84+
{{- end }}
85+
{{- if .Values.logger.level }}
86+
- --zap-log-level={{ .Values.logger.level }}
87+
{{- end }}
88+
{{- if .Values.logger.stacktraceLevel }}
89+
- --zap-stacktrace-level={{ .Values.logger.stacktraceLevel }}
90+
{{- end }}
8191

8292
env:
8393
- name: POD_NAMESPACE

helm/solr-operator/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919

2020
replicaCount: 1
2121

22+
# Development mode configures certain settings for convenient development.
23+
# When 'true', logging will use: encoder=console, level=debug, stacktrace-level=warn
24+
development: false
25+
26+
# These are default logger settings in production mode, but can be overridden here
27+
logger: {}
28+
#encoder: json
29+
#level: error
30+
#stacktraceLevel: error
31+
2232
image:
2333
repository: apache/solr-operator
2434
tag: v0.10.0-prerelease

0 commit comments

Comments
 (0)