The config namespace in the Contentstack CLI provides commands to configure various settings, including logging preferences.
The config:set:log command lets you configure the logging behavior of the Contentstack CLI. You can set the preferred log level and specify a file path for storing log outputs.
Usage
csdx config:set:log [--level <level>] [--path <path>]Options
| Flag | Short Flag | Description |
|---|---|---|
| --level | - | Set the log level for the CLI. Supported values: debug, info, warn, error |
| --path | - | Specify the directory path where logs should be saved. |
| --show-console-logs | - | Enable console logging. Use --no-show-console-logs to disable it. |
Examples
csdx config:set:log --level debugcsdx config:set:log --level info --path ./logs/app.logWarning: The configuration key for this setting changed between major versions. V1 stored it as log["show-console-logs"] and the current CLI reads log["showConsoleLogs"]. After you upgrade, the older key is ignored with no warning and console logging falls back to its default. Run csdx config:set:log --show-console-logs once after upgrading to write the key in the form the current CLI reads.
The config:get:log command retrieves the current logging settings, including the log level and the file path where logs are stored. If no configuration is set, the CLI will indicate that no logging configuration is available.
Usage
csdx config:get:log