-
Notifications
You must be signed in to change notification settings - Fork 493
feat: automatic debug log file with daily rotation #6236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
cmd/celestia-appd/cmd/file_logger.go
Outdated
| ) | ||
|
|
||
| const ( | ||
| FlagEnableDebugLog = "enable-debug-log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original issue: #6079 doesn't mention a new CLI flag. Can you please clarify the scope of the issue (ideally with the issue creator) before implementing changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see.
|
Wasn't sure if "automatically" meant default-on or opt-in with auto-rotation. Went with opt-in for backward compatibility. @rach-id What's your preference - default enabled or require a flag? Easy to change either way. |
|
Hey @animeherox, thanks for working on this.
I think it's better to have it enabled by default. I don't see a benefit of disabling it. Also, let's set a limit on the debug logs files not to exceed 20mb or so, so that they're compact and allow easier debugging. We could keep like the last 5 files and rotate on them. What do you think? |
- Default enabled with 20MB max file size - Keep last 5 log files - Auto-compress old logs - Use lumberjack for rotation - Add --disable-debug-log flag to turn off
|
@rach-id Done. Default enabled now, 20MB files, keeps 5 backups, compresses old ones. Added |
Closes #6079
Adds support for automatically saving debug logs to disk.
Usage
Logs go to
~/.celestia-app/logs/debug-YYYY-MM-DD.logby default. New file created daily. Both console and file get the logs.