Skip to content

fix(logging): initialize logger from config in the standalone bridge#1955

Open
chiefmojo wants to merge 1 commit into
MemTensor:dev-20260604-v2.0.19from
chiefmojo:fix/daemon-init-logger
Open

fix(logging): initialize logger from config in the standalone bridge#1955
chiefmojo wants to merge 1 commit into
MemTensor:dev-20260604-v2.0.19from
chiefmojo:fix/daemon-init-logger

Conversation

@chiefmojo

Copy link
Copy Markdown

Problem

The standalone bridge (bridge.cts) calls bootstrapMemoryCoreFull without passing initLogging: true. The logger stays on its bootstrap-console default, ignoring config.logging.* entirely. In practice this means logging.timezone has no effect when running as a daemon — logs are always stamped UTC regardless of config.

Fix

Add initLogging: true to the bootstrapMemoryCoreFull call in bridge.cts. The non-daemon stdio path (bridge/stdio.ts) already passes this flag correctly; this aligns the daemon path.

const { core, config, home } = await bootstrapMemoryCoreFull({
  // ...
  home: resolvedHome,
  initLogging: true,  // initialize logger from config.logging (timezone, level, channels)
});

The MemOS daemon (`bridge.cts`) resolved config inside
`bootstrapMemoryCoreFull` but never called `initLogger`, so the active
logger stayed on the `bootstrapConsoleOnly()` default with `tz` pinned to
"UTC". This made `logging.timezone` (PR MemTensor#44) inert in the daemon — and the
rest of `logging.*` (level, channels, file/audit/llm/perf/events sinks)
dead too. Pretty/compact timestamps kept printing UTC regardless of config.

Add an opt-in `initLogging` flag to `BootstrapOptions`. When set,
`bootstrapMemoryCoreFull` calls `initLogger(config, home)` right after
config resolution, before anything logs. The standalone bridge passes it;
embedded plugin hosts (`adapters/openclaw/index.ts`) leave it off so the
host keeps control of its own logging.

Test: bootstrap with `logging.timezone` set + `initLogging: true` stamps
records with the configured tz; without the flag the logger is untouched.
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.

1 participant