#11305: fix(logging): remove redundant subsystem prefix from log output
stale
Cluster:
Hooks and UI Fixes
## Summary
Removes duplicate subsystem display in `openclaw logs` output by eliminating tslog's `prefix` option from `getChildLogger()`.
## Problem
Each log line showed the subsystem twice:
```
17:20:00 info gateway/channels/feishu {"subsystem":"gateway/channels/feishu"} feishu[default]: received message...
```
The first occurrence is the label (correctly extracted from `_meta.name`). The second is redundant noise from tslog's prefix mechanism leaking into positional args.
## Root Cause
The `prefix` was added during the pino → tslog migration (commit `d463c82c9`) as an attempt to preserve pino's child logger binding behavior. However:
- `name` already captures the subsystem in `_meta.name`
- `parseLogLine` extracts subsystem from `_meta.name`
- `prefix` just injects redundant subsystem JSON into message body
## Changes
1. **src/logging/logger.ts** — Remove `prefix` from `getChildLogger()` options
2. **src/logging/parse-log-line.test.ts** — Update test to match new log format (no prefix in positional args)
## Result
```
17:20:00 info gateway/channels/feishu feishu[default]: received message...
```
Clean, readable logs with no duplication.
## Test Plan
- ✅ Unit tests pass: `pnpm test src/logging/parse-log-line.test.ts`
- ✅ Build succeeds: `pnpm build`
- ✅ Linters pass: `pnpm check`
- ✅ Verified log output shows no subsystem duplication
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR removes tslog’s `prefix` option from `getChildLogger()` so that child-logger bindings are carried only via `_meta.name` (and therefore the CLI’s label extraction), eliminating the duplicated subsystem string that previously appeared in positional log args.
Tests in `src/logging/parse-log-line.test.ts` are updated to reflect the new emitted JSON shape: the message is now just the original first positional argument (e.g. `"connected"`) rather than including the redundant `{"subsystem":...}` prefix.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is narrowly scoped to removing tslog’s `prefix` injection for child loggers, and the corresponding unit test update aligns with how `parseLogLine` constructs the message from numeric positional fields. No other behavior changes were identified in the affected code paths.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#11281: fix(logging): prevent subsystem loggers from bypassing file log lev...
by janckerchen · 2026-02-07
82.1%
#23669: refactor(logging): migrate node-host and tailscale console calls to...
by kevinWangSheng · 2026-02-22
78.5%
#9974: refactor(agents): replace console.warn with SubsystemLogger in comp...
by dinakars777 · 2026-02-05
77.0%
#12308: fix(cli): redirect log output to stderr during completion script ge...
by mcaxtr · 2026-02-09
76.9%
#9425: refactor(agents): replace console.warn with SubsystemLogger in comp...
by dinakars777 · 2026-02-05
76.6%
#11153: refactor(hooks): replace console.warn/error with subsystem logger
by hclsys · 2026-02-07
76.5%
#19611: fix: use local timezone in log file and console timestamps
by tag-assistant · 2026-02-18
76.5%
#9461: refactor(cli): replace console.warn with SubsystemLogger in health.ts
by dinakars777 · 2026-02-05
75.7%
#11549: lint: add no-console rule and migrate 5 files to structured logger
by vaibhavtupe · 2026-02-08
75.6%
#3392: fix(hooks): remove debug console.log statements from session-memory...
by WinJayX · 2026-01-28
75.2%