Skip to content

Conversation

@animeherox
Copy link
Contributor

@animeherox animeherox commented Nov 21, 2025

Closes #6079

Adds support for automatically saving debug logs to disk.

Usage

celestia-appd start --enable-debug-log
celestia-appd start --enable-debug-log --log-dir /custom/path

Logs go to ~/.celestia-app/logs/debug-YYYY-MM-DD.log by default. New file created daily. Both console and file get the logs.

)

const (
FlagEnableDebugLog = "enable-debug-log"
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see.

@rootulp rootulp marked this pull request as draft November 21, 2025 18:17
@animeherox
Copy link
Contributor Author

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.

@rach-id
Copy link
Member

rach-id commented Nov 22, 2025

Hey @animeherox, thanks for working on this.

What's your preference - default enabled or require a flag? Easy to change either way.

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
@animeherox
Copy link
Contributor Author

@rach-id Done. Default enabled now, 20MB files, keeps 5 backups, compresses old ones. Added --disable-debug-log in case anyone needs it off.

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.

Automatically save debug logs on disk

3 participants