Skip to content

feat: stdout logging#2288

Draft
kkovaacs wants to merge 11 commits into
nextfrom
krisztian/stdout-log-layer
Draft

feat: stdout logging#2288
kkovaacs wants to merge 11 commits into
nextfrom
krisztian/stdout-log-layer

Conversation

@kkovaacs

Copy link
Copy Markdown
Contributor

Summary

This separates user-visible stdout logging from production telemetry by giving stdout its own filter and moving local-development messages onto user:: log targets.

Changes

  • Add separate tracing filters for stdout and OpenTelemetry:
    • MIDEN_STDOUT_FILTER, falling back to RUST_LOG, then info,user=debug
    • MIDEN_OTEL_FILTER, falling back to RUST_LOG, then info,axum::rejection=trace
  • Keep stdout formatting compact and focused on user-visible output.
  • Add user::... log targets for node, remote prover, validator, block producer, RPC, and store components.
  • Move local-development state/action logs to debug! events on user:: targets.
  • Keep telemetry-oriented attributes on spans so they remain available to OpenTelemetry exporters.
  • Add per-handler RPC spans and record request-derived fields such as account IDs, block ranges, transaction IDs, and reference blocks after parsing.
  • Reduce noisy emitted events by moving verbose request payloads and internal details to trace!.
  • Remove several verbose ret(level = "debug") instrumented return logs from store queries.
  • Clean up block producer and store tracing around block application, transaction input loading, proof scheduling, and RPC/store connectivity.

Notes

The default stdout behavior now shows normal info logs plus user-targeted debug events, without raising debug verbosity for production telemetry. OpenTelemetry keeps its own independent filter so span export behavior can be tuned separately from local console output.

Changelog

[[entry]]
scope       = "general"
impact      = "changed"
description = "Logs printed to standard output have been changed to be human readable. gRPC requests and internal state changes should be now visible."

kkovaacs added 11 commits June 26, 2026 14:26
Instead of using RUST_LOG to control _both_ telemetry export and what is
printed to stdout this change splits configuration into two environment
variables (both with reasonable defaults):

MIDEN_STDOUT_FILTER is used to set the EnvFilter filter expression for what
is printed to stdout. If not specified, it falls back to using RUST_LOG,
then a reasonable default for output that is usable for a local development
setup. (More on that later.)

MIDEN_OTEL_FILTER is the name of the environmet variable controlling what
gets exported via OpenTelemetry. This also falls back to using RUST_LOG if
not configured explicitly and has the same default value we've been using
previously.

Configuration for the stdout layer has also changed: no file names / line
numbers are printed, no log lines for closing spans. The idea is that we'll
add _explicit_ debug!() events with a specific target (prefixed with
`user::`) so that it's easy to filter for these explicit events.

These events should cover all state changes relevant during development,
all gRPC queries received, etc.
Only events we explicitly want to show up on stdout by default should be
emitted on DEBUG level (or above).

Also adds some spans so that proper context is available when applying
the block.
Add per-handler spans with all relevant information so that the events
emitted from handlers have proper context.

Clean up emitted events so that only events we'd like to print to stdout
with the default config should be using DEBUG (or above).
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.

1 participant