Skip to content

fix(logging): give non-default profiles their own gateway log file - #112777

Merged
steipete merged 2 commits into
mainfrom
claude/profile-log-path
Jul 22, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/profile-log-path

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators running the default Gateway alongside a named profile, especially --dev, would get both processes interleaved in the same daily file log. That made CLI, RPC, and Control UI log forensics ambiguous.

Why This Change Was Made

The canonical log-path resolver now derives a filename-safe, collision-resistant segment from OPENCLAW_PROFILE, while preserving the historical unqualified filename for the default profile. The logger and log-tail fallback share the same resolved target and rolling-mode decision, so explicit logging.file overrides keep their prior semantics and a missing profile log cannot fall back to another profile's family.

User Impact

The default profile still writes openclaw-YYYY-MM-DD.log. Named profiles write their own openclaw-<profile>-YYYY-MM-DD.log family, including openclaw-dev-YYYY-MM-DD.log, and openclaw --profile <profile> logs plus Control UI Settings > Logs follow that same file.

Evidence

  • node scripts/run-vitest.mjs src/logging/log-file-path.test.ts src/logging/log-tail.test.ts src/logging/log-file-size-cap.test.ts src/logging/logger-settings.test.ts src/logging/logger.browser-import.test.ts — 26 tests passed across 2 routed shards.
  • node scripts/check-changed.mjs -- <18 touched files> — core and core-test TypeScript, changed-file lint, formatting, Plugin SDK API baseline, import-cycle checks, and all selected guards passed.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean; no accepted/actionable findings.

@steipete
steipete requested a review from a team as a code owner July 22, 2026 21:37
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: signal Channel integration: signal app: macos App: macos gateway Gateway runtime security Security documentation size: M maintainer Maintainer-authored PR labels Jul 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Live proof (integration merge of the four Wave-1 branches, dev gateway, real crabbox AWS worker, 2026-07-22): with the dev-profile gateway running, /tmp/openclaw/openclaw-dev-2026-07-22.log was created and received all dev-gateway entries while the default-profile openclaw-2026-07-22.log stayed separate — the interleaving that motivated this fix is gone.

@steipete steipete self-assigned this Jul 22, 2026
@steipete
steipete force-pushed the claude/profile-log-path branch from 502169c to 5f6781e Compare July 22, 2026 22:50
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper findings and Rank-up moves reviewed against exact head 5f6781e:

  • Named-profile path migration: explicitly accepted by the owner for this owner-approved landing. The historical default-profile path is unchanged, explicit logging.file remains unchanged, and the operator-facing migration is documented across the affected logging, diagnostics, Gateway, Signal, macOS, FAQ, and startup pages.
  • Release-owned changelog finding: rejected against the current root AGENTS.md rule, which requires a changelog for a user-facing landed fix unless it is contributor-authored. This PR is maintainer-authored, so the focused Profile-isolated gateway logs bullet stays.
  • Final-head live transcript move: satisfied by the owner-supplied integrated proof at fix(logging): give non-default profiles their own gateway log file #112777 (comment). That run used the four-branch integration on a dev Gateway and real AWS worker and observed separate populated dev/default files. The pre-rebase tested commit 502169c5b6ad8ed8f17b0e7d4a02fdec06761d17 and rebased head have the same stable patch id, cb289b0cdda3fcb88cd79f194a64f2fd9431b675; exact-head focused tests, Codex AutoReview, and full CI are green. Per the owner direction, I am not expanding this lane with a duplicate live run.

@steipete

Copy link
Copy Markdown
Contributor Author

Correction to my previous ClawSweeper disposition: the executable scripts/pr prepare-run gate is more specific than the general prose rule and rejected the root changelog edit because this is not release automation or maintainer release closeout. I accepted that finding, removed only the changelog bullet in d572766, preserved the release-note context in the PR body and implementation commit, reran Codex AutoReview on the deletion cleanly, and reran scripts/pr review-init for the new head.

@steipete
steipete merged commit f556274 into main Jul 22, 2026
117 checks passed
@steipete
steipete deleted the claude/profile-log-path branch July 22, 2026 23:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos channel: signal Channel integration: signal docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR security Security documentation size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant