Skip to content

feat(openclaw): surface gatewayLogLevel from openclaw.json (#5060) - #5061

Merged
vivekchand merged 1 commit into
mainfrom
bot-fix/issue-5060-logging-level-not-surfaced
Aug 22, 2026
Merged

vivekchand merged 1 commit into
mainfrom
bot-fix/issue-5060-logging-level-not-surfaced

Conversation

@vivekchand

Copy link
Copy Markdown
Owner

Summary

Operators couldn't tell from the ClawMetry dashboard why lower-severity events were absent from the tailed gateway log. The _gateway_log_meta() function already surfaced log dir, archive count, and current file size — but silently omitted the configured minimum file-log level from openclaw.json.

This adds gatewayLogLevel to the metadata dict when logging.level is set in openclaw.json.

Changes

  • clawmetry/adapters/openclaw.py: Add _read_logging_level_config() helper (mirrors the existing _read_logging_file_config() pattern — same OPENCLAW_HOME fallback, ~/.clawdbot alt path, graceful empty-string return, never raises). Call it in _gateway_log_meta() and propagate the result as gatewayLogLevel when non-empty.
  • tests/test_obs_gap_logging_level_5060.py: 8 tests covering _read_logging_level_config() (present/absent/malformed config, case normalisation) and _gateway_log_meta() level propagation (included when configured, omitted when not).

Test plan

  • python3 -m pytest tests/test_obs_gap_logging_level_5060.py -q — all 8 pass (verified locally)
  • python3 -c 'import ast; ast.parse(open("clawmetry/adapters/openclaw.py").read())' — syntax OK (verified)
  • Smoke: set {"logging": {"level": "warn"}} in openclaw.json, restart ClawMetry, confirm gatewayLogLevel: "warn" appears in the detect/health JSON response

Bot meta

Draft PR opened autonomously based on the plan in #5060. Marked draft for human review — mark Ready for Review once happy.

Closes #5060


Generated by Claude Code

Add _read_logging_level_config() (mirrors _read_logging_file_config pattern)
and propagate the result as gatewayLogLevel in _gateway_log_meta(), so
operators can see why lower-severity events are absent from the tailed log.

Closes #5060

Co-Authored-By: ClawMetry Autofix Bot <bot-autofix@clawmetry.dev>

Copy link
Copy Markdown
Owner Author

Autonomous maintainer pass (2026-08-22): draft assessment.

Code quality: clean. _read_logging_level_config() is an exact structural match to _read_logging_file_config() (same OPENCLAW_HOME env fallback, same ~/.clawdbot alt-path, same never-raises contract). Integration in _gateway_log_meta() is minimal and correct (3 lines, omits key when empty). 8 tests cover present/absent/malformed config, case normalisation, and _gateway_log_meta() propagation.

CI: 26/27 checks complete, all green. One still running: "Entitlement API tests" (started 06:29 UTC — this check ran ~12 min on the previous PR and passed; no entitlement code changes in this PR).

Recommendation: once "Entitlement API tests" completes green, this is ready to mark ready-for-review and merge. No conflicts with the other open PR (#5055 touches different files). Value is clear — operators can now see gatewayLogLevel in the health/detect response and understand why low-severity events are absent from the gateway log.


Generated by Claude Code

@vivekchand
vivekchand marked this pull request as ready for review August 22, 2026 09:36
@vivekchand
vivekchand merged commit 0f88576 into main Aug 22, 2026
27 of 28 checks passed
@8090-software-factory

Copy link
Copy Markdown

✅ Drift Bot (ClawMetry): no drift detected

Drift Bot analyzed the changed files against this project's blueprints and requirements and found no drift.

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.

[obs-gap:openclaw] OpenClaw: configured file-log level/severity filter not surfaced

1 participant