Skip to content

Conversation

@e7217
Copy link
Contributor

@e7217 e7217 commented Oct 29, 2025

Hello,

Description

Adds support for file rolling based on file size in the file sink. This allows users to rotate files when they reach a specified size threshold, in addition to the existing time-based and count-based rolling options.

Motivation

Currently, the file sink only supports rolling by:

  • Time interval (rollingInterval)
  • Number of records (rollingCount)

However, users may want to limit file sizes to prevent excessively large files, which is a common requirement for log rotation and file management systems.

Example Configuration

{
  "file": {
    "path": "/data/logs/app.log",
    "rollingSize": 10485760,  // 10MB
    "rollingCount": 0,
    "rollingInterval": 0
  }
}

Thank you for making such a lightweight tool.

e7217 and others added 2 commits October 30, 2025 00:58
Signed-off-by: Changyong Um <e7217@naver.com>
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
@ngjaying ngjaying changed the title feat: Add rollingSize option to file sink for size-based file rotation feat(io): add rollingSize option to file sink Oct 30, 2025
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.46%. Comparing base (8a59ad3) to head (8b5563d).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3910      +/-   ##
==========================================
+ Coverage   71.42%   71.46%   +0.04%     
==========================================
  Files         453      453              
  Lines       51923    51936      +13     
==========================================
+ Hits        37082    37114      +32     
+ Misses      11942    11927      -15     
+ Partials     2899     2895       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ngjaying ngjaying requested a review from Yisaer October 30, 2025 04:12
@ngjaying
Copy link
Collaborator

LGTM! This looks good and aligns perfectly with our roadmap.

@ngjaying ngjaying merged commit f09c8d1 into lf-edge:master Oct 30, 2025
66 of 68 checks passed
@e7217 e7217 deleted the feat/add-rollingsize-to-filesink branch October 30, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants