-
Notifications
You must be signed in to change notification settings - Fork 326
Description
Currently, the log level in Litestream can only be configured through the configuration file. While this aligns with the project's philosophy of keeping database and replica configuration in the config file, there are scenarios where adjusting the log level at runtime without modifying the configuration would be beneficial.
Problem
When debugging issues or monitoring Litestream behavior, users need to:
- Edit the configuration file to change the log level
- Restart Litestream
- Remember to revert the configuration change afterward
This workflow is cumbersome, especially in production environments where configuration files may be managed by automation tools or where quick debugging is needed.
Proposed Solution
Add a --log-level CLI flag that overrides the configuration file setting when provided:
litestream replicate -config /etc/litestream.yml --log-level debugThis would:
- Keep the existing configuration file
logging.levelsetting as the default - Allow temporary override via CLI flag for debugging sessions
- Follow the pattern used by many other tools where operational parameters (like verbosity) can be adjusted at runtime
Implementation Notes
- The flag would accept values:
debug,info,warn,error - CLI flag takes precedence over config file setting when specified
- This aligns with keeping database/replica configuration in the config file while allowing operational adjustments via CLI
Benefits
- Easier debugging: Quick log level changes without config file modifications
- Better ops experience: Temporary verbose logging without permanent config changes
- Cleaner separation: Keeps operational controls (log level) separate from data configuration (databases/replicas)
- Familiar pattern: Many CLI tools support
-vor--log-levelflags for runtime verbosity control
This proposal maintains the project's philosophy of not putting database/replica configuration in CLI arguments while providing a quality-of-life improvement for operational tasks.