Skip to content

Log trace context option (v3) - #11

Open
frenzzy wants to merge 1 commit into
static-web-server:masterfrom
frenzzy:log-trace-context
Open

frenzzy wants to merge 1 commit into
static-web-server:masterfrom
frenzzy:log-trace-context

Conversation

@frenzzy

@frenzzy frenzzy commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

v3 docs for the --log-trace-context option proposed in static-web-server/static-web-server#760 (issue static-web-server/static-web-server#759). Rebased on the current master.

  • features/logging.md: a new "Logging Trace Context" section. When enabled and a request has a valid W3C traceparent header, the log lines written for the request get the top-level trace_id, span_id and trace_flags fields (OpenTelemetry "Trace Context in Non-OTLP Log Formats"). It covers the per-request response line, the --access-log-format line and the lines logged while the request is handled (e.g. the error_page warning). Lines logged outside the request handler, such as connection errors or the HTTPS redirect listener, are not covered. The section also documents the json log format requirement, the default (disabled) and an example with a 404. The "Per-request logging" section mentions the new fields.
  • configuration/cli.md, configuration/env.md, configuration/file.md: the --log-trace-context option, the SERVER_LOG_TRACE_CONTEXT env and the log-trace-context key under [general].

Please merge this only together with (or after) the code PR.

prettier --check, markdownlint-cli2, vue-tsc and yarn build pass.

Describe the `--log-trace-context` option that adds the trace context of a
valid W3C `traceparent` request header to the JSON log lines written for the
request (the `response` line, the access log format line and the lines
logged while the request is handled), and list it in the CLI, environment
variable and config file references.

This branch has not been deployed

No deployments
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