Skip to content

feat: add configurable log splitting for run.log#5197

Draft
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-log-splitting-feature
Draft

feat: add configurable log splitting for run.log#5197
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-log-splitting-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

What problem does this PR solve?

Problem Summary:

ckb run writes continuously to data/logs/run.log, which can become very large during long-running sync and slow down incident-time troubleshooting. Operators need an opt-in way to split logs by time window while keeping current behavior by default.

What is changed and how it works?

What's Changed:

  • Logger config
    • Adds logger.log_file_split with supported values:
      • "never": current single-file behavior
      • "hourly": one main log file per UTC hour
      • "daily": one main log file per UTC day
[logger]
log_file_split = "hourly"
  • Log file naming

    • Hourly files use: run.YYYY-MM-DD-HH.log
    • Daily files use: run.YYYY-MM-DD.log
    • Example: data/logs/run.2026-03-10-20.log
  • Runtime behavior

    • Default remains run.log.
    • Time-windowed files are selected using the log record timestamp.
    • Extra loggers are unchanged.
  • Config template

    • Documents log_file_split in generated ckb.toml.

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • No breaking backward compatibility

Agent-Logs-Url: https://github.com/nervosnetwork/ckb/sessions/6d47ed5b-2f72-4b9b-b9f4-a8eb9588bac7

Co-authored-by: eval-exec <46400566+eval-exec@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configurable log splitting for run.log feat: add configurable log splitting for run.log Apr 30, 2026
Copilot AI requested a review from eval-exec April 30, 2026 09:55
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.

Optimization suggestion: add configurable log splitting for run.log

2 participants