Skip to content

Logging

qh3 can collect QLOG events in memory or write one JSON trace per connection to a directory.

from qh3 import QuicConfiguration, QuicFileLogger

configuration = QuicConfiguration(
    is_client=True,
    quic_logger=QuicFileLogger("qlog"),
)

Traffic secrets can be written separately by assigning an open text file to QuicConfiguration.secrets_log_file. Treat that file as sensitive.

QuicLogger

A QUIC event logger which stores traces in memory.

to_dict

to_dict()

Return the traces as a dictionary which can be written as JSON.

QuicFileLogger

Bases: QuicLogger

A QUIC event logger which writes one trace per file.

QuicLoggerTrace and its encoding helpers are internal implementation details.