Logging enhancements - #141
Merged
englishm merged 4 commits intoFeb 18, 2026
Merged
Conversation
itzmanish
approved these changes
Feb 5, 2026
nnazo
approved these changes
Feb 17, 2026
Replace the log crate with tracing throughout the codebase as Phase 1
of the logging/tracing migration. This aligns moq-rs with the broader
Rust ecosystem (tokio, hyper, axum) and enables future enhancements
like structured fields and spans.
Changes:
- Replace all log::{trace,debug,info,warn,error}! macros with tracing equivalents
- Update Cargo.toml files to use tracing and tracing-subscriber
- Remove log and env_logger dependencies from workspace
- Update binary main.rs files to use tracing_subscriber::fmt() with EnvFilter
- Default log filter: info level with quinn=warn to suppress QUIC noise
Backward compatible:
- RUST_LOG environment variable still works
- Output destination unchanged (stdout/stderr)
- Log message format unchanged for this phase
Add structured tracing fields (namespace, track, error, source, etc.) to log messages in moq-relay-ietf while preserving the original message format for backward compatibility with existing text-based searches. This enables: - Filtering logs by namespace/track in Elasticsearch - Structured queries without breaking existing workflows - Easier debugging by having key identifiers as separate JSON fields Files updated: - consumer.rs: announce/subscribe flows - producer.rs: subscribe/track_status handling - relay.rs: session error handling - remote.rs: remote origin handling - file_coordinator.rs: namespace registration - api_coordinator.rs: API-based coordination The message body remains unchanged - fields are duplicated in both the message string and as separate structured fields.
Add debug-level tracing logs for all MoQT control messages sent and received on the control stream. Each log includes: - direction: 'sent' or 'recv' - msg_type: message type name (e.g., SUBSCRIBE, PUBLISH_NAMESPACE_OK) - Message-specific fields matching the mlog schema Uses custom target 'moq_transport::control' so these logs can be filtered independently via tracing-subscriber's EnvFilter. This allows applications like crique to enable these logs in production while keeping moq-transport quiet by default for other users. Control messages logged: - Setup: CLIENT_SETUP, SERVER_SETUP - Subscribe family: SUBSCRIBE, SUBSCRIBE_OK, SUBSCRIBE_ERROR, SUBSCRIBE_UPDATE, UNSUBSCRIBE - PublishNamespace family: PUBLISH_NAMESPACE, PUBLISH_NAMESPACE_OK, PUBLISH_NAMESPACE_ERROR, PUBLISH_NAMESPACE_DONE, PUBLISH_NAMESPACE_CANCEL - TrackStatus family: TRACK_STATUS, TRACK_STATUS_OK, TRACK_STATUS_ERROR - SubscribeNamespace family: SUBSCRIBE_NAMESPACE, SUBSCRIBE_NAMESPACE_OK, SUBSCRIBE_NAMESPACE_ERROR, UNSUBSCRIBE_NAMESPACE - Fetch family: FETCH, FETCH_OK, FETCH_ERROR, FETCH_CANCEL - Publish family: PUBLISH, PUBLISH_OK, PUBLISH_ERROR, PUBLISH_DONE - Session: GOAWAY, MAX_REQUEST_ID, REQUESTS_BLOCKED
Add logging for: - Announce lifecycle (coordinator registration, locals registration, ANNOUNCE_OK) - Announce closed events - Locals deregistration on drop - Track cache operations (hit/miss/stale eviction) - Track close and state drop events Track cache logging uses target 'moq_transport::tracks' for independent filtering.
englishm-cloudflare
force-pushed
the
logging-tracing-migration
branch
from
February 18, 2026 02:09
9cfa730 to
33b7499
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
logcrate totracingacross all moq-rs cratesChanges
1. Tracing Migration (
391d0a4)log::{trace,debug,info,warn,error}!macros withtracing::equivalents (~200 call sites)tracing_subscriberwith env filter2. Structured Fields (
d39e98e)namespace,track,error,source,relay_url,origin_url3. Control Message Logging (
8bb7a07)log_control_message()helper inmoq-transport/src/session/mod.rsmoq_transport::controlfor independent filteringdirection("sent"/"recv"),msg_type, plus message-specific fields4. Additional Debug Logging (
9cfa730)moq_transport::tracksFiltering Examples
Sample Output
Testing