Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-cli): add file logging by default for start commands (#2175)
## Description Adds file logging by default to commands that start a node. Parameters are: - the "RUST_LOG" directive, in the form of and env var `IROH_FILE_RUST_LOG` or in the configuration file. - rotation: how often a new file is created. Either daily, hourly or never. - max files: Maximum number of files to keep File logging can be disabled by either setting the max_files to 0 in the configuration file or by setting the rust log statement to off, in either the env var or the config file. (example config file) ```toml [file_logs] rust_log = "iroh=trace" rotation = "daily" max_files = 1 ``` The files created live the `IROH_DATA_DIR/logs` dir and are named `iroh-2024-03-02.log` (for a daily rotation, or with the hour, for an hourly rotation) By default, we log everything in debug, rotating hourly, keeping at most 4 files (so total 4 hours of logs). This is short default since debug logs, even in an idle node, are a lot ## Notes & open questions n/a ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] Tests if relevant. --------- Co-authored-by: Floris Bruynooghe <[email protected]>
- Loading branch information