Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

[logging] — log output

File-based logging with size-based rotation. Disabled by default; logs go to stderr.

[logging]
enabled = false
log_directory = "llm-mem-data/logs"
level = "info"
max_size_mb = 1
max_files = 5
FieldDefaultWhat it controls
enabledfalseIf true, write to llm-mem-mcp.log in log_directory in addition to stderr.
log_directory"llm-mem-data/logs"Directory for the rotating log file. Created if missing.
level"info"Default level: error, warn, info, debug, trace.
max_size_mb1Rotate the log when it exceeds this size.
max_files5Keep this many rotated log files (e.g. llm-mem-mcp.log.1, .2, etc.).

Per-request verbosity

The level setting is the default, but the RUST_LOG env var (set in the MCP config’s env block) overrides it per-process. It accepts the tracing_subscriber filter syntax:

"env": {
  "RUST_LOG": "info,llama_cpp_2=warn,llm_mem::search=debug"
}

This sets the global default to info, silences llama_cpp_2 to warn, and turns on debug for the search module.

Stderr vs file

When logging.enabled = true:

  • The MCP JSON-RPC traffic goes to stdout (untouched — required by the protocol)
  • All tracing events go to stderr (always) and to the rotating log file (when enabled)

This means the MCP client can talk to the server without log lines contaminating the protocol stream.

Examples

Quiet (errors only):

[logging]
enabled = true
level = "error"

Verbose debugging:

[logging]
enabled = true
level = "debug"

Larger log files, more history:

[logging]
enabled = true
max_size_mb = 50
max_files = 10

Next