Skip to content

Configure operator logging in helm chart #779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Mar 26, 2025

Adds this to values.yaml:

# Development mode configures certain settings for convenient development.
# When 'true', logging will use: encoder=console, level=debug, stacktrace-level=warn
development: false

# These are default logger settings in production mode, but can be overridden here
logger: {}
  #encoder: json
  #level: error
  #stacktraceLevel: error

Docs:
Skjermbilde 2025-04-03 kl  19 23 11

Note that today zap "Development" mode has been the default, but this PR changes that to false, triggering production mode by default, and thus also log-level INFO and encoding to JSON. This is perhaps a bit much change in a minor version even if it is easy for users to tailor it. At the same time it feels wrong that development is the default mode. We could keep the default of development=true and change it to false in v1.0?

Fixes #778

@HoustonPutman
Copy link
Contributor

There is no impetus for a v1.0 right now, so I don't think there would be an issue doing this in v0.10.0

@@ -191,6 +191,10 @@ The command removes all the Kubernetes components associated with the chart and
| tolerations | []object | | Specify a list of Kubernetes tolerations for the Solr Operator pod |
| priorityClassName | string | `""` | Give a priorityClassName for the Solr Operator pod |
| sidecarContainers | []object | | An optional list of additional containers to run along side the Solr Operator in its pod |
| logger.devel | boolean | `false` | Enable development mode for the Solr Operator logger. This will log at the debug level with the console encoder. Default is `false` which logs at `info` level with `json` encoder. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[0] I could see the dev/prod distinction being useful for setting defaults totally unrelated to logging (docker image tag, resource limits, etc.). Wdyt about moving this "mode" flag up to the top level, so it's easier to expand later to cover other things if desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I promoted it to top level development, which can then be used elsewhere later.

janhoy and others added 4 commits April 3, 2025 19:08
# Conflicts:
#	helm/solr-operator/Chart.yaml
…o feature/helm-logging-config

# Conflicts:
#	helm/solr-operator/Chart.yaml
@janhoy janhoy requested a review from gerlowskija April 8, 2025 13:08
@janhoy
Copy link
Contributor Author

janhoy commented Apr 8, 2025

I added some docs

  • CLI opts
  • Helm change-entry for the change of default log format and level
  • upgrade-notes.md

Copy link
Contributor

@gerlowskija gerlowskija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow easy configuration of logging in helm
3 participants