From 39a84f043034c9539bc7453fecc3ecce77d5a823 Mon Sep 17 00:00:00 2001 From: Wenqi He Date: Wed, 14 May 2025 13:36:58 +1000 Subject: [PATCH] Add log level configuration instruction --- content/en/docs/concepts/monitoring.md | 4 ++- .../en/docs/concepts/package-configuration.md | 31 ++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/content/en/docs/concepts/monitoring.md b/content/en/docs/concepts/monitoring.md index 521010e..cd693b4 100644 --- a/content/en/docs/concepts/monitoring.md +++ b/content/en/docs/concepts/monitoring.md @@ -9,7 +9,9 @@ Package Operator exports metrics on the `/metrics` endpoint which can be used to monitor PKO and packages. These are exported by the `package-operator-manager` pod. In order to monitor PKO a monitoring stack including Prometheus is required. -This example will assume you have [Prometheus Operator]() installed. +This example will assume you have +[Prometheus Operator]() +installed. ## RBAC diff --git a/content/en/docs/concepts/package-configuration.md b/content/en/docs/concepts/package-configuration.md index 0d1f4d5..a5972ee 100644 --- a/content/en/docs/concepts/package-configuration.md +++ b/content/en/docs/concepts/package-configuration.md @@ -595,7 +595,36 @@ Example `manifest.yaml`: These steps guided you through deploying and updating your application using package configuration and ClusterObjectTemplates with the Package Operator. -## Error Messages and Troubleshooting +## Troubleshooting + +### Logging Behavior + +The `logLevel` configuration helps you control the verbosity of logs to aid in troubleshooting. + +To increase verbosity for troubleshooting, +update the `logLevel` via the `spec.config` field of your `ClusterPackage`. +For example: + +```bash +kubectl patch clusterpackage package-operator \ + --type=merge \ + -p '{"spec": {"config": {"logLevel": 1}}}' +``` + +**Log Level Reference:** + +| `logLevel` | Output Includes | +|------------|----------------------------------------------------------------------------------| +| `-1` | `log.Error()` – Default level; errors logs shown. | +| `0` | `log.Error()` and `log.Info()` – Base level of informational logs. | +| `1` | `log.Error()`, `log.Info()`, and `log.V(1).Info()` – Adds first level of debug. | +| `2` | Above plus `log.V(2).Info()` – includes second-level debug logs. | +| ... | Increasing verbosity with higher numbers – adds `log.V(N).Info()` for N ≥ 3. | + +This setting is helpful when debugging reconciliation behavior, +unexpected resource changes, or communication issues across clusters. + +### Error Messages and Troubleshooting During the package configuration process, you may encounter common errors such as missing or incorrectly formatted values. Here are some