Repository navigation
Conversation
The Axum adapter initialized simple_logger without reading RUST_LOG, so it always logged at trace, including OpenRTB bid request bodies and TCF consent strings. Resolve the level from RUST_LOG and default to info when it is unset or unrecognized, matching the Fastly adapter. Warn on standard error when a set value is ignored, and document the setting in the Axum guide. Closes #1129 Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Review summary
Reviewed 0b149636304e0e7f184a9f3298f56f9b10d669a8 against cb945254521ed6dab365072f7caec10c524e323b. Both changed files were reviewed, including logger initialization, pinned dependency behavior, request handlers, and scripts consuming Axum output. No actionable issues introduced by this PR were found.
Safety proof
Runtime verification confirmed that the configured level controls actual output without changing HTTP behavior. A live-binary probe passed 12 cases covering every supported level, unset and blank values, whitespace and case normalization, and invalid filters. An actual EC trace record appeared only at trace; off suppressed all logs. Invalid filters warned on stderr. Every case retained /health HTTP 200 and malformed /auction HTTP 400.
Validation and review context
cargo test-axum: 48 tests passed; one documentation example ignored.cargo fmt --all -- --check,cargo clippy-axum, andcargo build-axum: passed.- In-memory Python live-binary logging matrix: all 12 cases passed after correcting a fixture rejected for known placeholder domains.
cd docs && npm run format: blocked locally becauseprettieris unavailable. The CI docs check passed.- All reported CI checks passed, including Axum tests, target-matched linting, docs formatting/build, parity, and integration tests.
- No existing reviews, inline comments, review threads, or PR issue comments were found.
- Residual risk: APS payload-specific trace output was not reproduced; the shared logging filter was verified through a real EC trace record.
The revision remained unchanged and the worktree stayed clean. No files were edited and no review work was delegated.
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
The Axum logger now honors a single-level RUST_LOG setting and defaults to info. The startup warning, parser tests, and documentation agree with the selected behavior. No blocking or non-blocking findings.
Reviewed commit: 0b149636304e0e7f184a9f3298f56f9b10d669a8.
Validation
Read both changed files and compared the removed startup code, checked the pinned simple_logger and log implementations, and checked the EdgeZero startup path for competing logger initialization. Validation relies on GitHub CI; no local test suite was rerun.
CI Status
- integration tests: PASS
- browser integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- CodeQL: PASS
- prepare integration artifacts: PASS
- cargo test (ts CLI, native): PASS
- format-typescript: PASS (required)
- cargo test (cross-adapter parity): PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- Analyze (rust): PASS
- format-docs: PASS (required)
- cargo test: PASS (required)
- vitest: PASS
- Analyze (actions): PASS
- cargo test (axum native): PASS
- cargo fmt: PASS (required)
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- Analyze (javascript-typescript): PASS
- CLAUDE.md symlink guard: PASS
- Analyze (javascript-typescript): PASS
Summary
RUST_LOGand always logged attrace, which floods stdout and writes full OpenRTB bid request bodies and TCF consent strings during routine local runs. It now reads the maximum level fromRUST_LOG.RUST_LOGis unset, the default is nowinfo(matching the Fastly adapter) instead oftrace. Nothing in the repo relies on Axum trace output: the integration harness discards Axum stdout, CI and scripts already setRUST_LOG=info, and the smoke script only checks error-level lines.trace,debug,info,warn,error,off). Per-module filter syntax such astrace,hyper=infois not supported; it falls back toinfoand prints a startup warning to stderr.Changes
crates/trusted-server-adapter-axum/src/main.rsresolve_max_level(parsesRUST_LOG, defaults toinfo) andunrecognized_log_level(detects set-but-ignored values); pass the level toSimpleLogger::with_level; warn on stderr for unrecognized values; add unit tests for both helpers.docs/guide/axum-dev.mdtraceoutput.The warning uses
eprintln!only because the logger is not initialized yet at that point. This matches the existingPORTand logger-init warnings inmain, which already sit under#[allow(clippy::print_stderr)].Closes
Closes #1129
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute servecargo clippy-cloudflare && cargo clippy-cloudflare-wasm && cargo clippy-spin-native && cargo clippy-spin-wasm && cargo clippy-cli && cargo clippy-codegen,cargo test-cloudflare && cargo test-spin, and the parity test (cargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity)Checklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!); the startupeprintln!runs before the logger exists