Logging
Octopus logs through the tracing crate with a
tracing_subscriber formatting layer, writing to the process's standard output.
How logging is initialized01
When you run octopus serve, the CLI loads the configuration first and then
initializes the subscriber from observability.logging, so the configured level
and format take effect. The subscriber installs:
a formatting layer — text (default) or JSON lines (
format: json); the per-event target is suppressed;an
EnvFilterseeded from the resolved level, with a built-in directive that quiets noisymdns_sdlibrary logs towarnand above.
Level02
The effective level is resolved with this precedence:
the
servecommand's--log-levelflag, if given;otherwise
observability.logging.levelfrom the config;otherwise
info.
RUST_LOG layers on top via EnvFilter (per-module directives supported).
# From config (observability.logging.level)
octopus serve -c gateway.yaml
# Override the level for one run
octopus serve -c gateway.yaml --log-level debug
# RUST_LOG directives (per-module overrides)
RUST_LOG=octopus_proxy=trace,info octopus serve -c gateway.yamlAccepted values are trace, debug, info, warn, and error; an unrecognized
value falls back to info.
Format03
| Field | Type | Default | Effect |
observability.logging.level | string | info | Sets the base level (the --log-level flag overrides it). |
observability.logging.format | string (json | text) | text | json installs the JSON-lines formatter; anything else uses the human-readable text formatter. |
observability:
logging:
level: info
format: json # structured JSON lines--log-level overrides only the level, not the format. The format always comes
from observability.logging.format.
What gets logged04
The gateway emits tracing events across its components — request handling,
proxying, health checks, discovery syncs, lifecycle transitions, and admin
actions. Raising the level to debug or trace surfaces per-request path/method
logging in the request handler.
Related05
Tracing — distributed tracing status.
Configuration → Observability — the
loggingblock schema.