Skip to content

Conversation

julio4
Copy link
Contributor

@julio4 julio4 commented Aug 14, 2025

📝 Summary

Close #232

Overwrite current <CACHE_DIR>/reth/logs directory for log files to <CACHE_DIR>/op-rbuilder/logs directory.
Still configurable with --log.file.directory arg.

💡 Motivation and Context

Using reth's Cli, we already inherit different tracing layers for logging.
The default value for the file logger point to <CACHE_DIR>/reth/logs.
If running op-rbuilder with reth, this can mix cache files.

This PR correctly set the file log output. You can access by default debug level trace and access log at:

  • ~/.cache/op-rbuilder/logs on Linux
  • ~/Library/Caches/op-rbuilder/logs on macOS
  • %localAppData%/op-rbuilder/logs on Windows

Additional file logging configuration (accessible with --help):

      --log.file.format <FORMAT>
          The format to use for logs written to the log file
          
          [default: terminal]

          Possible values:
          - json:     Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
          - log-fmt:  Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
          - terminal: Represents terminal-friendly formatting for logs

      --log.file.filter <FILTER>
          The filter to use for logs written to the log file
          
          [default: debug]

      --log.file.directory <PATH>
          The path to put log files in
          
          [default: <CACHE_DIR>/op-rbuilder/logs]

      --log.file.max-size <SIZE>
          The maximum size (in MB) of one log file
          
          [default: 200]

      --log.file.max-files <COUNT>
          The maximum amount of log files that will be stored. If set to 0, background file logging is disabled
          
          [default: 5]

The log file is still named reth.log, this open PR should make it configurable paradigmxyz/reth#17883


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@julio4 julio4 force-pushed the feat/tracing-layer-cache-file branch from 9b7188e to 192ccac Compare August 14, 2025 22:09
Copy link
Collaborator

@avalonche avalonche left a comment

Choose a reason for hiding this comment

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

you might need to update log dirs for integration / test files and README docs

@julio4 julio4 force-pushed the feat/tracing-layer-cache-file branch from 192ccac to 3c82b0f Compare September 19, 2025 05:40
@julio4
Copy link
Contributor Author

julio4 commented Sep 19, 2025

you might need to update log dirs for integration / test files and README docs

Added docs but I didn't found parsing of logs in tests. Do you have any pointers?

@avalonche
Copy link
Collaborator

maybe in builder-playground or rollup-boost integration tests

@julio4
Copy link
Contributor Author

julio4 commented Sep 24, 2025

maybe in builder-playground or rollup-boost integration tests

Did a quick search and didn't find any mention of directly getting logs with the full path to reth/logs. Seems like tests have their own LogConsumer and this PR should not change behaviors of this.

@avalonche avalonche merged commit 36260c6 into flashbots:main Sep 25, 2025
4 checks passed
@julio4 julio4 deleted the feat/tracing-layer-cache-file branch September 26, 2025 00:56
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.

Create additional logging layer for all debug logs

2 participants