Skip to content

[draft]qlog: Implement MoQQLogFactory to enhance logging for QUIC connections#242

Open
akash-a-n wants to merge 4 commits into
feature/mlog-samplingfrom
feature/qlog-sampling
Open

[draft]qlog: Implement MoQQLogFactory to enhance logging for QUIC connections#242
akash-a-n wants to merge 4 commits into
feature/mlog-samplingfrom
feature/qlog-sampling

Conversation

@akash-a-n

@akash-a-n akash-a-n commented May 30, 2026

Copy link
Copy Markdown

This change is Reviewable

akash-a-n added 4 commits May 29, 2026 17:26
- Add setWriteExecutor() for asynchronous off-thread disk I/O
- Pre-format logs on calling thread, move serialized data to executor
- Add setDir() for directory prefix support via derivePath()
- Avoid this capture by moving all data into lambda
- Update FileMLoggerFactory to support new features
- Add test coverage for FileMLogger and FileMLoggerFactory
- New wrapper factory that applies per-session sampling
- Uses folly::Random::oneIn() for thread-safe sampling
- Enables selective logging (e.g., 1%% of sessions) in production
- Add test coverage for SamplingMLoggerFactory
- Log DCID for incoming QUIC connections in onNewConnectionImpl()
- Log DCID for WebTransport CONNECT in onWebTransportConnectImpl()
- Enable MLogger creation and attachment to MoQ sessions

@akash-a-n akash-a-n left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@afrind
I wanted to get you thoughts on this integration pattern that wraps the TransportFactory.
Since we use HQServer for WebTransport connections, I am unable to set an asynchronous logger for qlogs because proxygen's HQServerTransportFactory's make function hardcodes streaming to false.
Ideally having a factory in proxygen makes more sense as its the owner, but I don't know if they can be persuaded in time for the change.
Let me know if this method is fine or if you have any other ideas?

@akash-a-n made 1 comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@afrind afrind left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If you have a targeted change to proxygen, we can get it landed upstream pretty quickly. Seems like that would be a little cleaner than this wrapped pattern?

@afrind reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@akash-a-n akash-a-n left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

create this, but I need your help with CLA:
facebook/proxygen#622

@akash-a-n made 1 comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

meta-codesync Bot pushed a commit to facebook/proxygen that referenced this pull request Jun 5, 2026
Summary:
This change provides a way for downstream apps like moxygen and moqx to have a configurable qlogger.
Currently, There isn't a straight forward way to enable async logging or log sampling without a wrapper of our own, something like this: openmoq/moxygen#242

___

Differential Revision: D107700435

fbshipit-source-id: c9f768325d1ab85deb7eb6185670da3284861fe8
meta-codesync Bot pushed a commit to facebook/hhvm that referenced this pull request Jun 5, 2026
Summary:
This change provides a way for downstream apps like moxygen and moqx to have a configurable qlogger.
Currently, There isn't a straight forward way to enable async logging or log sampling without a wrapper of our own, something like this: openmoq/moxygen#242

___

Differential Revision: D107700435

fbshipit-source-id: c9f768325d1ab85deb7eb6185670da3284861fe8
@akash-a-n akash-a-n force-pushed the feature/mlog-sampling branch from 6ae1cc9 to 49a31a3 Compare June 26, 2026 15:19
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