Skip to content

fix: bootstrapMemoryCoreFull never calls initLogger — file logs (memos.log, llm.jsonl, audit.log) never written #2147

Description

@7889545

Pre-submission checklist

  • I have searched existing issues and this hasn't been mentioned before
  • I have read the project documentation and confirmed this issue doesn't already exist
  • This issue is specific to MemOS and not a general software issue

Bug Description

Summary

bootstrapMemoryCoreFull() in core/pipeline/memory-core.ts never calls initLogger(config, home). The logger remains in the bootstrapConsoleOnly() mode (console + memoryBuffer + broadcast only), so all file transports are never created — memos.log, error.log, audit.log, llm.jsonl, perf.jsonl, events.jsonl are all missing.

Root Cause

In memory-core.ts, after loadConfig(home) returns, the code proceeds directly to rootLogger.child(...) without calling initLogger(config, home) first:

// memory-core.ts line ~190
const config = configResult.config;
// ← Missing: initLogger(config, home);
const log = rootLogger.child({
    channel: "core.pipeline.bootstrap",
    ...
});

The initLogger function (from core/logger/index.ts) is responsible for creating FileRotatingTransport instances based on config.logging.file.enabled. Without this call, the logger stays in bootstrap mode.

Meanwhile, config.logging.file.enabled is true by default (defaults.ts line 279), and the config API confirms it's set — but the transports are never instantiated.

Evidence

  1. MEMOS_HOME/logs/ directory is empty (no log files at all)
  2. The config API returns "logging": { "file": { "enabled": true } }
  3. initLogger is exported from core/logger/index.ts but never imported or called in the pipeline bootstrap code
  4. The memory buffer transport works (SSE viewer shows logs), confirming the logger itself is functional — only file transports are missing

Impact

  • No persistent log files for debugging
  • No audit trail (audit.log)
  • No LLM call history (llm.jsonl)
  • No performance metrics (perf.jsonl)
  • Users cannot diagnose issues from logs

Proposed Fix

Add initLogger(config, home) after config is loaded and before first log output:

const config = configResult.config;
// Initialize file transports (logs, audit, llm, perf, events).
initLogger(config, home);
const log = rootLogger.child({
    channel: "core.pipeline.bootstrap",
    ...
});

Also add the import:

import { rootLogger, initLogger } from "../logger/index.js";

Environment

  • MemOS: v2.0.20 (memos-local-plugin)
  • OS: Windows 11
  • Agent: Hermes Agent

Metadata

Metadata

Labels

area:pluginOpenClaw & Hermesstatus:in-progressSomeone or AI is working on it | 人工或 AI 正在处理types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions