diff --git a/docs/LOG_MANAGEMENT.md b/docs/LOG_MANAGEMENT.md index 2d9cc2401..4aa7ff309 100644 --- a/docs/LOG_MANAGEMENT.md +++ b/docs/LOG_MANAGEMENT.md @@ -15,23 +15,7 @@ RustDesk uses `flexi_logger` for logging with automatic log rotation. Logs are w ### Current Rotation Policy -The logging system (implemented in `libs/hbb_common/src/lib.rs`) currently uses: - -```rust -.rotate( - Criterion::Age(Age::Day), // Rotate daily - Naming::Timestamps, - Cleanup::KeepLogFiles(31), // Keep last 31 days -) -``` - -**Limitation**: Individual log files have no size limit. If a single day's activity generates excessive logs, the file could grow very large and consume significant disk space. - -## Recommended Enhancement - -### Size-Based Rotation - -To prevent individual log files from growing unbounded, add size-based rotation: +The logging system (implemented in `libs/hbb_common/src/lib.rs`) uses size-based rotation: ```rust .rotate( @@ -51,11 +35,11 @@ To prevent individual log files from growing unbounded, add size-based rotation: ### Implementation -The change needs to be made in the `hbb_common` library: +The implementation is in the `hbb_common` library: **File**: `libs/hbb_common/src/lib.rs` **Function**: `init_log()` -**Line**: ~405 +**Line**: ~407 ```diff - Criterion::Age(Age::Day), diff --git a/docs/patches/README.md b/docs/patches/README.md index 20733c490..443028d1f 100644 --- a/docs/patches/README.md +++ b/docs/patches/README.md @@ -1,32 +1,24 @@ # Patches for hbb_common -This directory contains patches that should be applied to the `hbb_common` library submodule. +This directory contains patches for reference. The changes described have already been applied to the `hbb_common` submodule in this PR. ## hbb_common-log-rotation.patch +**Status**: ✅ Already applied in this PR (submodule commit 0c401fd) + **Purpose**: Add size-based log rotation to prevent excessive disk usage **Apply to**: `libs/hbb_common` submodule **Target repository**: https://github.com/rustdesk/hbb_common -### How to apply +### Reference Information -#### Option 1: Apply in hbb_common repository +This patch file is provided for: +- Documentation of the exact changes made +- Reference for maintainers +- Potential cherry-picking to other branches if needed -```bash -cd /path/to/hbb_common -git apply /path/to/rustdesk/docs/patches/hbb_common-log-rotation.patch -git commit -m "Add size-based log rotation to prevent excessive disk usage" -``` - -#### Option 2: Apply in rustdesk repository submodule - -```bash -cd libs/hbb_common -git apply ../../docs/patches/hbb_common-log-rotation.patch -git commit -m "Add size-based log rotation to prevent excessive disk usage" -# Note: This creates a local commit in the submodule -``` +The changes have already been implemented in the submodule updated by this PR. ### What it does