|  | 
|  | 1 | +# Increasing Logging Verbosity | 
|  | 2 | + | 
|  | 3 | +When troubleshooting issues with **bootc**, it is often helpful to enable **verbose logging** to gain additional insights into its execution flow. | 
|  | 4 | + | 
|  | 5 | +## Using the `--verbose` Flag | 
|  | 6 | +Most **bootc** commands support the `--verbose` flag, which enables detailed logging output. The verbosity level determines how much information is logged. | 
|  | 7 | + | 
|  | 8 | +### **Verbosity Levels** | 
|  | 9 | +The `--verbose` flag can be used multiple times (`-v`, `-vv`, `-vvv`) to increase the verbosity of logging: | 
|  | 10 | + | 
|  | 11 | +| Verbosity Level | Flag Used | Logs Enabled | | 
|  | 12 | +|---------------|-----------|--------------| | 
|  | 13 | +| **WARN** (default) | *(no flag)* | Only warnings and errors | | 
|  | 14 | +| **INFO** | `-v` | Warnings, errors, and general information | | 
|  | 15 | +| **DEBUG** | `-vv` | Info, warnings, errors, and debug logs | | 
|  | 16 | +| **TRACE** | `-vvv` or more | All logs, including low-level tracing | | 
|  | 17 | + | 
|  | 18 | +### Example Usage | 
|  | 19 | +To switch to a new container image with verbose logging enabled: | 
|  | 20 | +```sh | 
|  | 21 | +bootc switch --apply -vv quay.io/centos-bootc/centos-bootc:stream9 | 
|  | 22 | +``` | 
|  | 23 | +This command will print **INFO, DEBUG, and WARN logs**, helping diagnose issues during the `switch` process. | 
|  | 24 | + | 
|  | 25 | +### Example Output (Verbose Mode Enabled with `-vv`) | 
|  | 26 | +```sh | 
|  | 27 | +$ bootc switch --apply -vvv quay.io/centos-bootc/centos-bootc:stream9 | 
|  | 28 | +TRACE Verified uid 0 with CAP_SYS_ADMIN | 
|  | 29 | +DEBUG Re-executing current process for _ostree_unshared | 
|  | 30 | +DEBUG Already in a mount namespace | 
|  | 31 | +DEBUG Current security context is unconfined_u:system_r:install_t:s0:c1023 | 
|  | 32 | +INFO We have install_t | 
|  | 33 | +INFO Staged: None | 
|  | 34 | +DEBUG Rollback queued=false | 
|  | 35 | +DEBUG Wrote merge commit b8761b75924d7f21e7f92abc8fd8b3c645d289fc91555 | 
|  | 36 | +DEBUG new_with_config: Spawned skopeo pid=1023 | 
|  | 37 | +TRACE new_with_config: impl_request: sending request Initialize | 
|  | 38 | +TRACE new_with_config: impl_request: completed request Config=ImageProxy | 
|  | 39 | +``` | 
|  | 40 | +With `-vvv`, the output includes **INFO, DEBUG, WARN, and TRACE** level messages. | 
|  | 41 | + | 
|  | 42 | +## Using the `RUST_LOG` Environment Variable | 
|  | 43 | +For even more detailed logging, use the `RUST_LOG` environment variable (if applicable for Rust-based components): | 
|  | 44 | + | 
|  | 45 | +```sh | 
|  | 46 | +RUST_LOG=debug bootc switch --apply -vvv quay.io/centos-bootc/centos-bootc:stream9 | 
|  | 47 | +``` | 
|  | 48 | +The environment variable will override the `-vvv` and enable **DEBUG** level logs for Rust-based sub-components within **bootc**. | 
0 commit comments