fix(logging): expose trace fields in file logs

This commit is contained in:
Vincent Koc
2026-04-26 12:23:42 -07:00
parent edf40ab6c9
commit df542f75a9
5 changed files with 83 additions and 23 deletions

View File

@@ -150,6 +150,10 @@ When any subkey is enabled, model and tool spans get bounded, redacted
- **Logs:** OTLP logs respect `logging.level` (file log level). They use the
diagnostic log-record redaction path, not console formatting. High-volume
installs should prefer OTLP collector sampling/filtering over local sampling.
- **File-log correlation:** JSONL file logs include top-level `traceId`,
`spanId`, `parentSpanId`, and `traceFlags` when the log call carries a valid
diagnostic trace context, which lets log processors join local log lines with
exported spans.
## Exported metrics

View File

@@ -157,6 +157,13 @@ You can override both via the **`OPENCLAW_LOG_LEVEL`** environment variable (e.g
`--verbose` only affects console output and WS log verbosity; it does not change
file log levels.
### Trace correlation
File logs are JSONL. When a log call carries a valid diagnostic trace context,
OpenClaw writes the trace fields as top-level JSON keys (`traceId`, `spanId`,
`parentSpanId`, `traceFlags`) so external log processors can correlate the line
with OTEL spans and provider `traceparent` propagation.
### Console styles
`logging.consoleStyle`: