Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Based on #497 , there is currently no way to set the log level declaratively. I'd like to propose/request a feature to solve this.
I think it can be addressed by adding a setting on the ObjectStore's instanceSidecarConfiguration. For example:
...
spec:
instanceSidecarConfiguration:
managerArgs:
- "--log-level debug"This would give users control to set the full set of CLI args:
➜ ~ docker run -it ghcr.io/cloudnative-pg/plugin-barman-cloud-sidecar:v0.5.0 --help
Usage:
manager [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
healthcheck healthcheck commands
help Help about any command
instance Starts the Barman Cloud CNPG-I sidecar plugin
operator Starts the BarmanObjectStore reconciler and the Barman Cloud CNPG-i plugin
restore Starts the Barman Cloud CNPG-I sidecar plugin
Flags:
-h, --help help for manager
--log-destination string where the log stream will be written
--log-field-level string JSON log field to report severity in (default: level)
--log-field-timestamp string JSON log field to report timestamp in (default: ts)
--log-level string the desired log level, one of error, info, debug and trace (default "info")
--zap-devel Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error)
--zap-encoder encoder Zap log encoding (one of 'json' or 'console')
--zap-log-level level Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', 'panic'or any integer value > 0 which corresponds to custom debug levels of increasing verbosity
--zap-stacktrace-level level Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').
--zap-time-encoding time-encoding Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.
Use "manager [command] --help" for more information about a command.It also seems consistent with the existing archiveAdditionalCommandArgs and restoreAdditionalCommandArgs on the WalBackupConfiguration and the additionalCommandArgs on the DataBackupConfiguration
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
armru commentedon Sep 9, 2025
Would using the
Envfield help with that?alexklibisz commentedon Sep 9, 2025
Using the env vars is not sufficient on its own. They don't get passed through to any of the CLI flags.
alexklibisz commentedon Sep 9, 2025
Here's one option as a temporary workaround:
SIDECAR_IMAGE=your-custom-docker-image. This is what dictates the image used for the sidecar on each instance.LOG_LEVEL=debug.armru commentedon Sep 15, 2025
what you have described is correct, we don't set the env as defaults inside the addflags func
armru commentedon Sep 15, 2025
Opened #520
feat(spec): add support for additional sidecar container arguments (c…