Exporting Configuration via Logging
Cadenza provides a convenient way to export configuration settings in YAML format by logging them to the application log. This feature is particularly useful when migrating from a multi-file XML configuration to a single-file YAML configuration or when exploring the available configuration structure.
The logged output can be customized using two environment variables:
-
CADENZA_CONFIG_LOGGING_FORMAT: Specifies the format of the output (yamlorenv) -
CADENZA_CONFIG_LOGGING_CONTENT: Specifies the content type (unresolvedorsample)
Logging Modes
Cadenza supports two distinct logging content modes:
unresolved
This mode outputs the currently active configuration for the enabled plugins, as defined in the configuration files. It includes:
-
All values that have been explicitly set
-
All defined variables
However, it excludes:
-
Any default values that have not been explicitly set
-
Resolution of environment variables or system properties — these remain in placeholder form (e.g.,
$SYSTEM{MY_VAR})
This mode is ideal for migrating from an existing multi-file configuration to a single-file YAML configuration, as it reflects exactly what is set in the current configuration source.
sample
This mode provides a structural overview of the configuration, populated with hard-coded sample values. It is useful for exploring the available configuration options without needing to activate all plugins or define every variable.
-
Inactive plugins are not included
-
Values are for demonstration purposes only and should be replaced in production
How to Log Configuration Settings
To generate and export the configuration via logging:
-
Set the following environment variables before starting the application:
export CADENZA_CONFIG_LOGGING_FORMAT=yaml export CADENZA_CONFIG_LOGGING_CONTENT=sample -
Start or restart Cadenza
-
Locate the configuration output in the log file
-
Copy the output into a new
YAMLconfiguration file (if needed)
The following example generates a sample YAML configuration:
CADENZA_CONFIG_LOGGING_FORMAT=yaml
CADENZA_CONFIG_LOGGING_CONTENT=sample
The Logging Output
When configuration logging is enabled, the application log will include the exported configuration settings in the chosen format.
Depending on the selected format:
-
yaml: Outputs a YAML representation of the configuration -
env: Outputs the equivalent environment variable override keys and values
The log may include either:
-
The active configuration (
unresolvedmode), reflecting currently defined plugin settings and variables -
A sample configuration (
samplemode), showing a complete structure with illustrative values
| Configuration output is written to the standard log stream. Make sure logging is properly configured to capture it (e.g. to a file or console). |
Best Practices
-
Use the
unresolvedmode to aid migration from multi-file to single-file configurations -
Use the
samplemode for onboarding and plugin exploration -
Validate any exported YAML manually before using it in production
-
Combine this feature with the
envmode to compare resolved and unresolved values, if needed