feat(logging): manage node log rotation, retention, and compression, close #257#256
feat(logging): manage node log rotation, retention, and compression, close #257#256gzliudan wants to merge 4 commits intoXinFinOrg:masterfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughStartup scripts now perform daily, in-process log rotation, retention, and optional compression: Changes
Sequence DiagramsequenceDiagram
participant Script as Startup Script
participant XDC as XDC Process
participant FS as File System
participant Compressor as Async Compressor
Script->>Script: compute current_log_file (xdc-YYYYMMDD-*.log) and next_rotation_epoch
Script->>XDC: start XDC (stdout+stderr piped to read loop)
loop for each output line
XDC->>Script: emit line
Script->>Script: if now >= next_rotation_epoch then rotate
alt rotate
Script->>FS: touch new current_log_file
Script->>Script: update current_log_file & next_rotation_epoch
end
Script->>FS: append line to current_log_file
Script->>Script: echo line to stdout
end
note over Compressor,FS: periodically (or on rotation) Compressor attempts compression
Compressor->>Compressor: obtain lock dir, detect stale locks via /proc, recover if needed
Compressor->>FS: gzip eligible .log → .log.gz (skip if gzip unavailable), remove tmp artifacts
XDC->>Script: exit
Script->>Script: read PIPESTATUS[0]
Script->>Script: exit with XDC's code
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
mainnet/start-node.sh (1)
36-45: Plan retention for the daily log files.Line 36 writes
xdc-YYYYMMDD.logunder/work/xdcchain, but nothing here compresses or expires older files. On long-lived nodes, those logs can eventually compete with chaindata for disk. Consider handing this directory off tologrotateor pruning after N days.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mainnet/start-node.sh` around lines 36 - 45, The script currently creates daily files in set_current_log_file using variables log_dir, current_log_date, current_log_file and next_rotation_epoch but does not rotate or prune older logs; add retention by either (a) integrating with system logrotate (write a /etc/logrotate.d/xdcchain snippet that rotates xdc-YYYYMMDD.log, compresses, and keeps N rotations) or (b) adding a simple pruning routine in the script that runs at midnight (or when next_rotation_epoch is reached) to gzip older logs and delete files older than N days (operate on files matching "${log_dir}/xdc-*.log"); update set_current_log_file or add a separate rotate_logs function to trigger compression/deletion and ensure it runs before creating a new current_log_file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@devnet/start.sh`:
- Around line 3-4: Replace the insecure append to /tmp/key with a secure
ephemeral temp file: create a temp file via mktemp (e.g., keyfile=$(mktemp)),
immediately chmod 600 "$keyfile", write the PRIVATE_KEY to it with an overwrite
write (printf '%s' "$PRIVATE_KEY" > "$keyfile"), call the import using that
variable (wallet=$(XDC account import --password .pwd --datadir /work/xdcchain
"$keyfile" | awk -F '[{}]' '{print $2}')), and ensure the temp file is removed
after import (use trap 'rm -f "$keyfile"' EXIT or rm -f "$keyfile" after the
import) so the key is not left on disk and repeated runs remain idempotent.
---
Nitpick comments:
In `@mainnet/start-node.sh`:
- Around line 36-45: The script currently creates daily files in
set_current_log_file using variables log_dir, current_log_date, current_log_file
and next_rotation_epoch but does not rotate or prune older logs; add retention
by either (a) integrating with system logrotate (write a
/etc/logrotate.d/xdcchain snippet that rotates xdc-YYYYMMDD.log, compresses, and
keeps N rotations) or (b) adding a simple pruning routine in the script that
runs at midnight (or when next_rotation_epoch is reached) to gzip older logs and
delete files older than N days (operate on files matching
"${log_dir}/xdc-*.log"); update set_current_log_file or add a separate
rotate_logs function to trigger compression/deletion and ensure it runs before
creating a new current_log_file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e99ea35e-512a-4170-9f16-b473f317beb8
📒 Files selected for processing (3)
devnet/start.shmainnet/start-node.shtestnet/start-apothem.sh
| echo "$PRIVATE_KEY" >>/tmp/key | ||
| wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') |
There was a problem hiding this comment.
Use an ephemeral, locked-down key file here.
Line 3 appends the raw private key to a predictable /tmp/key path and never removes it. That leaves sensitive material on disk and makes repeated starts non-idempotent because the file can accumulate multiple keys. Create a temp file with restrictive permissions, overwrite it, and delete it after import.
Suggested fix
if [ ! -d /work/xdcchain/XDC/chaindata ]; then
- echo "$PRIVATE_KEY" >>/tmp/key
- wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}')
+ key_file="$(mktemp /tmp/xdc-key.XXXXXX)"
+ chmod 600 "$key_file"
+ trap 'rm -f "$key_file"' EXIT
+ printf '%s\n' "$PRIVATE_KEY" >"$key_file"
+ wallet=$(XDC account import --password .pwd --datadir /work/xdcchain "$key_file" | awk -F '[{}]' '{print $2}')
XDC init --datadir /work/xdcchain /work/genesis.json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| echo "$PRIVATE_KEY" >>/tmp/key | |
| wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') | |
| if [ ! -d /work/xdcchain/XDC/chaindata ]; then | |
| key_file="$(mktemp /tmp/xdc-key.XXXXXX)" | |
| chmod 600 "$key_file" | |
| trap 'rm -f "$key_file"' EXIT | |
| printf '%s\n' "$PRIVATE_KEY" >"$key_file" | |
| wallet=$(XDC account import --password .pwd --datadir /work/xdcchain "$key_file" | awk -F '[{}]' '{print $2}') | |
| XDC init --datadir /work/xdcchain /work/genesis.json |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@devnet/start.sh` around lines 3 - 4, Replace the insecure append to /tmp/key
with a secure ephemeral temp file: create a temp file via mktemp (e.g.,
keyfile=$(mktemp)), immediately chmod 600 "$keyfile", write the PRIVATE_KEY to
it with an overwrite write (printf '%s' "$PRIVATE_KEY" > "$keyfile"), call the
import using that variable (wallet=$(XDC account import --password .pwd
--datadir /work/xdcchain "$keyfile" | awk -F '[{}]' '{print $2}')), and ensure
the temp file is removed after import (use trap 'rm -f "$keyfile"' EXIT or rm -f
"$keyfile" after the import) so the key is not left on disk and repeated runs
remain idempotent.
a9c134f to
feed5b6
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
devnet/start.sh (1)
3-4:⚠️ Potential issue | 🟠 MajorStill importing the key through a predictable
/tmp/keyfile.Line 3 appends a raw private key to disk and never removes it, so repeated starts can accumulate secrets and leave sensitive material behind. Please switch to a locked-down temp file and clean it up right after the import.
Suggested fix
- echo "$PRIVATE_KEY" >>/tmp/key - wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') + key_file="$(mktemp /tmp/xdc-key.XXXXXX)" + chmod 600 "$key_file" + trap 'rm -f "$key_file"' EXIT + printf '%s\n' "$PRIVATE_KEY" >"$key_file" + wallet=$(XDC account import --password .pwd --datadir /work/xdcchain "$key_file" | awk -F '[{}]' '{print $2}') + rm -f "$key_file" + trap - EXIT🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@devnet/start.sh` around lines 3 - 4, The script currently writes the raw PRIVATE_KEY to a predictable /tmp/key and never removes it; change the flow used around the XDC account import to create a secure, unique temp file (e.g., via mktemp) with restrictive permissions, write PRIVATE_KEY to that temp file, run the XDC account import and capture the wallet variable as before, then securely delete/unlink the temp file immediately after import (and add a trap to ensure cleanup on exit). Ensure you update the commands around the XDC account import (the line producing wallet=$(XDC account import ... /tmp/key | awk ...)) to point at the temp file and remove references to /tmp/key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@devnet/start.sh`:
- Around line 34-38: The filename currently includes time (%H%M%S) causing
multiple log files per day; in set_current_log_file change current_log_date to
use only the calendar date (date +%Y%m%d) so current_log_file becomes
"${log_dir}/xdc-${current_log_date}.log" and restarts will append to the same
daily file; keep touch "${current_log_file}" and next_rotation_epoch calculation
as-is so rotation still occurs at tomorrow 00:00:00.
In `@mainnet/start-node.sh`:
- Around line 41-45: The log filename uses a timestamp including
hours/minutes/seconds so each restart makes a new file; in set_current_log_file
change current_log_date to only the day (use date +%Y%m%d) and build
current_log_file as "${log_dir}/xdc-${current_log_date}.log" so restarts on the
same day continue the same file; keep next_rotation_epoch logic (date -d
'tomorrow 00:00:00' +%s) unchanged and ensure touch/create of current_log_file
still occurs if it doesn't exist.
In `@testnet/start-apothem.sh`:
- Around line 44-48: The current set_current_log_file function uses date format
%Y%m%d-%H%M%S (current_log_date) which creates a new per-start file; change
current_log_date to use only the date (e.g., date +%Y%m%d) so current_log_file
becomes xdc-YYYYMMDD.log and restarts on the same day reuse the same file, keep
the touch of "${current_log_file}" and keep next_rotation_epoch computed the
same way; update the variable current_log_date and current_log_file in
set_current_log_file accordingly.
---
Duplicate comments:
In `@devnet/start.sh`:
- Around line 3-4: The script currently writes the raw PRIVATE_KEY to a
predictable /tmp/key and never removes it; change the flow used around the XDC
account import to create a secure, unique temp file (e.g., via mktemp) with
restrictive permissions, write PRIVATE_KEY to that temp file, run the XDC
account import and capture the wallet variable as before, then securely
delete/unlink the temp file immediately after import (and add a trap to ensure
cleanup on exit). Ensure you update the commands around the XDC account import
(the line producing wallet=$(XDC account import ... /tmp/key | awk ...)) to
point at the temp file and remove references to /tmp/key.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0fc66dd3-e31d-4aa0-a8b6-a46759c6a115
📒 Files selected for processing (3)
devnet/start.shmainnet/start-node.shtestnet/start-apothem.sh
41ef3f8 to
55b6c2e
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (4)
mainnet/start-node.sh (1)
55-57:⚠️ Potential issue | 🟠 MajorThis is still restart-based, not day-based.
Line 68 still uses
%H%M%S, so a restart later the same day creates another file instead of appending toxdc-YYYYMMDD.log. Line 55 also still parses the timestamped shape, so retention needs the matching update too.Suggested fix
- if [[ "$log_name" =~ ^xdc-([0-9]{8})-[0-9]{6}\.log$ ]]; then + if [[ "$log_name" =~ ^xdc-([0-9]{8})\.log$ ]]; then log_date="${BASH_REMATCH[1]}" if [[ "$log_date" < "$retention_start_date" ]]; then rm -f -- "$log_file" deleted_logs=$((deleted_logs + 1)) fi fi @@ - current_log_date="$(date +%Y%m%d-%H%M%S)" + current_log_date="$(date +%Y%m%d)" current_log_file="${log_dir}/xdc-${current_log_date}.log"Also applies to: 67-70
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mainnet/start-node.sh` around lines 55 - 57, The retention check and rotation are still using timestamped filenames and the log creation still includes time (%H%M%S), so change the log naming to produce xdc-YYYYMMDD.log (remove the time suffix) where the file is created (replace use of %H%M%S), and update the parsing regex/pattern that sets log_date from log_name (currently using ^xdc-([0-9]{8})-[0-9]{6}\.log$) to match ^xdc-([0-9]{8})\.log$; also update any other places that construct or match log filenames (variables: log_name, log_date, retention_start_date) so retention compares the YYYYMMDD date only and multiple restarts on the same day append to the same file.testnet/start-apothem.sh (1)
58-60:⚠️ Potential issue | 🟠 MajorThis still creates per-start log files.
Line 71 still includes
%H%M%S, so same-day restarts will keep producingxdc-YYYYMMDD-HHMMSS.loginstead of reusingxdc-YYYYMMDD.log. Line 58 also still expects the timestamped filename, so retention needs to be adjusted in the same patch.Suggested fix
- if [[ "$log_name" =~ ^xdc-([0-9]{8})-[0-9]{6}\.log$ ]]; then + if [[ "$log_name" =~ ^xdc-([0-9]{8})\.log$ ]]; then log_date="${BASH_REMATCH[1]}" if [[ "$log_date" < "$retention_start_date" ]]; then rm -f -- "$log_file" deleted_logs=$((deleted_logs + 1)) fi fi @@ - current_log_date="$(date +%Y%m%d-%H%M%S)" + current_log_date="$(date +%Y%m%d)" current_log_file="${log_dir}/xdc-${current_log_date}.log"Also applies to: 70-73
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@testnet/start-apothem.sh` around lines 58 - 60, The log rotation/retention still treats filenames as timestamped per-start (regex ^xdc-([0-9]{8})-[0-9]{6}\.log$ and the %H%M%S in the rotation format) so same-day restarts create new files; change the filename format to date-only and update the matching/retention logic accordingly: update the regex that parses log_name to ^xdc-([0-9]{8})\.log$ (so log_date captures YYYYMMDD), remove %H%M%S from the log filename generation so logs are named xdc-YYYYMMDD.log, and ensure the comparison against retention_start_date still uses log_date and retention_start_date for correct deletion; apply the same change to the other occurrence mentioned (around lines 70-73).devnet/start.sh (2)
48-50:⚠️ Potential issue | 🟠 MajorUse the calendar day as the filename key.
Line 61 still includes
%H%M%S, so same-day restarts keep creatingxdc-YYYYMMDD-HHMMSS.loginstead of continuing onexdc-YYYYMMDD.log. Line 48 still matches the timestamped pattern, so retention needs to be updated in the same change.Suggested fix
- if [[ "$log_name" =~ ^xdc-([0-9]{8})-[0-9]{6}\.log$ ]]; then + if [[ "$log_name" =~ ^xdc-([0-9]{8})\.log$ ]]; then log_date="${BASH_REMATCH[1]}" if [[ "$log_date" < "$retention_start_date" ]]; then rm -f -- "$log_file" deleted_logs=$((deleted_logs + 1)) fi fi @@ - current_log_date="$(date +%Y%m%d-%H%M%S)" + current_log_date="$(date +%Y%m%d)" current_log_file="${log_dir}/xdc-${current_log_date}.log"Also applies to: 60-63
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@devnet/start.sh` around lines 48 - 50, The retention matching and log rotation should use the calendar day only: change the filename pattern that reads log_name and sets log_date to match ^xdc-([0-9]{8})\.log$ (no -HHMMSS) and update the creation logic so the logfile produced by the script is named xdc-YYYYMMDD.log (remove %H%M%S from the filename generation), then ensure comparisons against retention_start_date use the extracted log_date variable; update the corresponding checks around log_name, log_date and retention_start_date (also the same logic at the other occurrence around lines 60-63) so same-day restarts append to the same xdc-YYYYMMDD.log and retention deletes by day only.
3-4:⚠️ Potential issue | 🟠 MajorStop persisting the raw private key in
/tmp/key.Line 3 still appends the secret to a predictable file and never removes it. That leaves key material on disk and makes repeated bootstrap runs non-idempotent because multiple keys can accumulate in the same file.
Suggested fix
- echo "$PRIVATE_KEY" >>/tmp/key - wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') + key_file="$(mktemp /tmp/xdc-key.XXXXXX)" + chmod 600 "$key_file" + trap 'rm -f "$key_file"' EXIT + printf '%s\n' "$PRIVATE_KEY" >"$key_file" + wallet=$(XDC account import --password .pwd --datadir /work/xdcchain "$key_file" | awk -F '[{}]' '{print $2}')🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@devnet/start.sh` around lines 3 - 4, The script is writing the raw PRIVATE_KEY to a predictable file (/tmp/key) and never removing it; update the devnet start script so the key is not persisted to disk by piping the secret directly into the XDC import command or using a secure temporary file that is immediately deleted. Replace the echo >>/tmp/key + XDC account import flow with a here-string or stdin pipe (e.g. printf '%s\n' "$PRIVATE_KEY" | XDC account import --password .pwd --datadir /work/xdcchain /dev/stdin ...) or, if a temp file is required, create it with mktemp, set strict permissions, run XDC account import against it, and rm -f the temp file immediately after; ensure you still capture the wallet id as before (wallet=$(... | awk -F '[{}]' '{print $2}')).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@devnet/start.sh`:
- Around line 48-50: The retention matching and log rotation should use the
calendar day only: change the filename pattern that reads log_name and sets
log_date to match ^xdc-([0-9]{8})\.log$ (no -HHMMSS) and update the creation
logic so the logfile produced by the script is named xdc-YYYYMMDD.log (remove
%H%M%S from the filename generation), then ensure comparisons against
retention_start_date use the extracted log_date variable; update the
corresponding checks around log_name, log_date and retention_start_date (also
the same logic at the other occurrence around lines 60-63) so same-day restarts
append to the same xdc-YYYYMMDD.log and retention deletes by day only.
- Around line 3-4: The script is writing the raw PRIVATE_KEY to a predictable
file (/tmp/key) and never removing it; update the devnet start script so the key
is not persisted to disk by piping the secret directly into the XDC import
command or using a secure temporary file that is immediately deleted. Replace
the echo >>/tmp/key + XDC account import flow with a here-string or stdin pipe
(e.g. printf '%s\n' "$PRIVATE_KEY" | XDC account import --password .pwd
--datadir /work/xdcchain /dev/stdin ...) or, if a temp file is required, create
it with mktemp, set strict permissions, run XDC account import against it, and
rm -f the temp file immediately after; ensure you still capture the wallet id as
before (wallet=$(... | awk -F '[{}]' '{print $2}')).
In `@mainnet/start-node.sh`:
- Around line 55-57: The retention check and rotation are still using
timestamped filenames and the log creation still includes time (%H%M%S), so
change the log naming to produce xdc-YYYYMMDD.log (remove the time suffix) where
the file is created (replace use of %H%M%S), and update the parsing
regex/pattern that sets log_date from log_name (currently using
^xdc-([0-9]{8})-[0-9]{6}\.log$) to match ^xdc-([0-9]{8})\.log$; also update any
other places that construct or match log filenames (variables: log_name,
log_date, retention_start_date) so retention compares the YYYYMMDD date only and
multiple restarts on the same day append to the same file.
In `@testnet/start-apothem.sh`:
- Around line 58-60: The log rotation/retention still treats filenames as
timestamped per-start (regex ^xdc-([0-9]{8})-[0-9]{6}\.log$ and the %H%M%S in
the rotation format) so same-day restarts create new files; change the filename
format to date-only and update the matching/retention logic accordingly: update
the regex that parses log_name to ^xdc-([0-9]{8})\.log$ (so log_date captures
YYYYMMDD), remove %H%M%S from the log filename generation so logs are named
xdc-YYYYMMDD.log, and ensure the comparison against retention_start_date still
uses log_date and retention_start_date for correct deletion; apply the same
change to the other occurrence mentioned (around lines 70-73).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e8d99536-ca85-4152-9ada-3d0a68a0156e
📒 Files selected for processing (16)
devnet/envs/144.126.140.3-1devnet/envs/144.126.140.3-2devnet/envs/194.163.167.177-1devnet/envs/194.163.167.177-2devnet/envs/194.233.77.19-1devnet/envs/194.233.77.19-2devnet/envs/66.94.121.151-1devnet/envs/66.94.121.151-2devnet/envs/66.94.98.186-1devnet/envs/66.94.98.186-2devnet/start.shmainnet/.envmainnet/env.examplemainnet/start-node.shtestnet/.envtestnet/start-apothem.sh
✅ Files skipped from review due to trivial changes (11)
- devnet/envs/194.163.167.177-2
- devnet/envs/66.94.98.186-1
- devnet/envs/66.94.121.151-2
- devnet/envs/144.126.140.3-1
- devnet/envs/194.163.167.177-1
- devnet/envs/144.126.140.3-2
- devnet/envs/66.94.98.186-2
- devnet/envs/194.233.77.19-1
- devnet/envs/194.233.77.19-2
- mainnet/env.example
- devnet/envs/66.94.121.151-1
e0d4f7e to
225a6ca
Compare
Replace the mixed tee/redirection pipeline in the devnet, mainnet, and testnet startup scripts with a bash-native log streamer that creates the first timestamped log file before XDC starts and rotates on day boundaries. Mirror XDC output to stdout and the active daily log, forward TERM/INT, wait for both the XDC process and the log writer to exit, and preserve the node exit status. Mount the upstream entry.sh in the mainnet and testnet compose files and add a 60s stop_grace_period so containers can finish the shutdown path and flush logs before Docker sends SIGKILL.
225a6ca to
f184bab
Compare
Add LOG_KEEP_DAYS defaults to the mainnet, testnet, and devnet runtime configs. Delete expired xdc-*.log files on startup and after daily log rotation. Reject retention values below 3 days to avoid accidental log loss.
f184bab to
708cdbe
Compare
Add gzip compression for rotated logs in mainnet, testnet, and devnet startup scripts with lock-based async processing. Validate retention settings with LOG_KEEP_DAYS >= 3, LOG_UNCOMPRESSED_DAYS >= 2, and enforce LOG_UNCOMPRESSED_DAYS <= LOG_KEEP_DAYS; update env examples and README accordingly.
5f8882a to
0a51c1b
Compare
Update all shipped env files and startup script defaults to use log level 3 so new deployments and unset environments are more verbose by default.
Summary
This PR improves node log lifecycle management for devnet, mainnet, and testnet deployments.
It combines the logging changes in this branch into one operator-facing workflow:
2to3in shipped configuration files and script fallbacksWhat changed
/work/xdcchainLOG_KEEP_DAYSto control how many days of logs are retainedLOG_UNCOMPRESSED_DAYSto keep recent logs in plain text and gzip older retained logsLOG_LEVELfrom2to3in shipped env files and script defaultsMotivation and impact
Node logs currently require manual cleanup and can grow without bound over time. This PR reduces disk usage, keeps recent logs easy to inspect during operations, and makes log handling more consistent across devnet, mainnet, and testnet environments.
Raising the default log level to
3also makes fresh deployments more verbose out of the box, which improves operational visibility whenLOG_LEVELis not overridden.The resulting behavior is:
3unless operators setLOG_LEVELexplicitly