Skip to content

Console logging ignores BASIC_MEMORY_CONSOLE_LOGGING=false and log_level=ERROR settings #255

@rd162

Description

@rd162

Bug Description

Console logging outputs INFO and DEBUG messages despite being configured to disable console logging and set log level to ERROR.

Environment

  • Version: 0.14.3 (Homebrew installation)
  • OS: macOS
  • Shell: Fish

Configuration

~/.basic-memory/config.json:

{
  "projects": {
    "main": "/Users/rd/Obsidian/__MEMORY__",
    "obsidian": "/Users/rd/Obsidian",
    "generic": "/Users/rd/Obsidian/__MEMORY__/00"
  },
  "default_project": "main",
  "log_level": "ERROR",
  "sync_delay": 1000,
  "update_permalinks_on_move": true,
  "sync_changes": true
}

Environment variables:

set -gx BASIC_MEMORY_CONSOLE_LOGGING false
set -gx BASIC_MEMORY_LOG_LEVEL ERROR

Actual Behavior

Console shows INFO and DEBUG logs despite configuration:

❯ basic-memory project list
2025-08-18 06:09:22.839 | INFO     | basic_memory.utils:setup_logging:167 - ENV: 'dev' Log level: 'ERROR' Logging to .basic-memory/basic-memory-api.log
2025-08-18 06:09:22.840 | INFO     | basic_memory.config:setup_basic_memory_logging:367 - Basic Memory 0.14.3 (Project: main)
2025-08-18 06:09:23.665 | DEBUG    | basic_memory.api.template_loader:__init__:235 - Initialized template loader with directory: /opt/homebrew/Cellar/basic-memory/0.14.3/libexec/tools/basic-memory/lib/python3.13/site-packages/basic_memory/templates
2025-08-18 06:09:23.742 | DEBUG    | basic_memory.mcp.async_client:create_client:23 - Creating ASGI client for local Basic Memory API
2025-08-18 06:09:23.780 | INFO     | basic_memory.services.initialization:initialize_app:156 - Initializing app...
[... many more INFO/DEBUG logs ...]

Expected Behavior

No console logging should appear when BASIC_MEMORY_CONSOLE_LOGGING=false, or at minimum, only ERROR level logs should appear when log_level=ERROR.

Root Cause Analysis

The issue appears to be in the setup_logging() function where the console logging configuration is not properly respecting the environment variables. The log output shows the system recognizes log_level: 'ERROR' but console logging continues anyway.

Possible causes:

  1. Console logger being added despite console_logging=False
  2. Multiple logger setups overriding the configuration
  3. Environment variable parsing not working correctly in the logging setup

Workaround

basic-memory project list 2>/dev/null

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions