#15253: Adding structured log content
agents
stale
size: XL
Cluster:
Security Enhancements and Fixes
structured logs are extracted using automated scripts to make them easier for humans to read
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a Python log analyzer plus docs/examples, and instruments embedded runner/tool execution code to emit much richer structured log fields (prompt context, assistant reply/thinking, tool calls/results). It also updates logging settings resolution to support `{DATE}` placeholders and normalize non-absolute log file paths.
The main merge-blockers are that the new instrumentation logs full user prompts, tool results, and full assistant message structures at `info` level (persisted to disk by default), which is very likely to capture secrets/PII and tool output contents. Separately, the added analyzer script’s help text references a different filename than the one added, and there’s a stray `logs/log` file that looks accidental. The logger path resolution change also alters how relative log file paths behave and may need reconsideration or explicit documentation.
<h3>Confidence Score: 2/5</h3>
- Not safe to merge as-is due to high-likelihood sensitive data exposure in default log output.
- The new structured logging captures and persists raw prompts, tool outputs, and full assistant message structures at info/debug in multiple places, which is a likely secret/PII leak in normal operation. There are also correctness issues (analyzer help text refers to a different filename; stray committed file) and a behavior change in logger path resolution that can break existing configs.
- src/agents/pi-embedded-runner/run/attempt.ts; src/agents/pi-embedded-subscribe.handlers.tools.ts; src/logging/logger.ts; openclaw-log-analyzer.py; logs/log
<sub>Last reviewed commit: d381784</sub>
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8976: Add structured tracing for agent runs
by Anipaleja · 2026-02-04
76.1%
#11549: lint: add no-console rule and migrate 5 files to structured logger
by vaibhavtupe · 2026-02-08
75.9%
#9974: refactor(agents): replace console.warn with SubsystemLogger in comp...
by dinakars777 · 2026-02-05
75.8%
#22139: Fix(ui): improve log formatting for JSON payloads
by npmisantosh · 2026-02-20
75.7%
#23669: refactor(logging): migrate node-host and tailscale console calls to...
by kevinWangSheng · 2026-02-22
75.6%
#11281: fix(logging): prevent subsystem loggers from bypassing file log lev...
by janckerchen · 2026-02-07
74.5%
#9273: Add files via upload
by cyrilliu1974 · 2026-02-05
74.2%
#21699: feat(agents): add opt-in OpenAI payload logging for embedded runs
by jcp · 2026-02-20
73.8%
#7252: docs: align config examples and tool docs with current runtime
by nice-and-precise · 2026-02-02
73.6%
#11825: fix: keep tool_use/tool_result pairs together during session compac...
by C31gordon · 2026-02-08
73.6%