Skip to content
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

internal/debug: add --log.file option #26149

Merged
merged 2 commits into from
Nov 11, 2022
Merged

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Nov 10, 2022

This adds an option to direct log output to a file. This feature has been requested a lot. It's sometimes useful to have this available when running geth in an environment that doesn't easily allow redirecting the output.

@fjl
Copy link
Contributor Author

fjl commented Nov 10, 2022

Notably, there is no support for log rotation with this change. We used to have a RotatingFileHandler, but I deleted that in Jan 2020.

At this time, the --log.file option opens the file once on startup and then keeps writing to the file handle. This can become an issue when external log rotation tools are involved, so we might want to add support for re-opening the file when the process gets a signal or something.

@fjl fjl merged commit 5b4c149 into ethereum:master Nov 11, 2022
@fjl fjl added this to the 1.11.0 milestone Nov 11, 2022
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
This adds an option to direct log output to a file. This feature has been
requested a lot. It's sometimes useful to have this available when running
geth in an environment that doesn't easily allow redirecting the output.

Notably, there is no support for log rotation with this change. The --log.file option
opens the file once on startup and then keeps writing to the file handle. 
This can become an issue when external log rotation tools are involved, so it's
best not to use them with this option for now.
This pull request was closed.
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.

2 participants