Problem
DMG-installed users cannot change the log level. Two issues compound:
-
Hub PATCH writes .env but DMG startup doesn't read it: PATCH /api/config/env writes LOG_LEVEL=debug to resolve(projectRoot, '.env') and updates process.env in memory (config.ts:352-356). But the DMG app startup doesn't source .env — there's no dotenv in the Node code, and the DMG launcher doesn't go through start-dev.sh (which does source .env). After restart, process.env.LOG_LEVEL is undefined → falls back to default 'info'.
-
Runtime process.env update doesn't affect pino: Even during the current session, process.env.LOG_LEVEL = 'debug' has no effect because pino logger level is set at import time (logger.ts:22):
const LOG_LEVEL = (isDebugMode ? 'debug' : (process.env.LOG_LEVEL ?? 'info')) as pino.Level;
This is a module-level constant evaluated once at process start.
Result
LOG_LEVEL changes via Hub appear to save (UI shows "debug") but logs remain at level 30/40 (info/warn), never 20 (debug). Neither runtime change nor restart fixes it.
Fix
Option C (recommended): When PATCH /api/config/env changes LOG_LEVEL, also call logger.level = newValue to update the live pino instance. Pino supports runtime level changes natively. This gives instant effect without restart.
// In config.ts PATCH handler, after process.env update:
if (updates.has('LOG_LEVEL')) {
const { logger } = await import('../infrastructure/logger.js');
const newLevel = updates.get('LOG_LEVEL') || 'info';
logger.level = newLevel;
}
Additionally, for DMG startup persistence:
- Option B (complementary): Add
dotenv loading at API entry point, or have the DMG launcher source .env if it exists.
Impact
All DMG-installed users. Debug logging is the primary diagnostic tool — without it, users can't troubleshoot MCP loading failures, auth issues, etc.
Files
packages/api/src/routes/config.ts:294-397 — PATCH /api/config/env handler
packages/api/src/infrastructure/logger.ts:22 — import-time LOG_LEVEL capture
Problem
DMG-installed users cannot change the log level. Two issues compound:
Hub PATCH writes .env but DMG startup doesn't read it:
PATCH /api/config/envwritesLOG_LEVEL=debugtoresolve(projectRoot, '.env')and updatesprocess.envin memory (config.ts:352-356). But the DMG app startup doesn't source.env— there's nodotenvin the Node code, and the DMG launcher doesn't go throughstart-dev.sh(which doessource .env). After restart,process.env.LOG_LEVELis undefined → falls back to default'info'.Runtime process.env update doesn't affect pino: Even during the current session,
process.env.LOG_LEVEL = 'debug'has no effect because pino logger level is set at import time (logger.ts:22):This is a module-level constant evaluated once at process start.
Result
LOG_LEVEL changes via Hub appear to save (UI shows "debug") but logs remain at level 30/40 (info/warn), never 20 (debug). Neither runtime change nor restart fixes it.
Fix
Option C (recommended): When
PATCH /api/config/envchangesLOG_LEVEL, also calllogger.level = newValueto update the live pino instance. Pino supports runtime level changes natively. This gives instant effect without restart.Additionally, for DMG startup persistence:
dotenvloading at API entry point, or have the DMG launcher source.envif it exists.Impact
All DMG-installed users. Debug logging is the primary diagnostic tool — without it, users can't troubleshoot MCP loading failures, auth issues, etc.
Files
packages/api/src/routes/config.ts:294-397— PATCH /api/config/env handlerpackages/api/src/infrastructure/logger.ts:22— import-time LOG_LEVEL capture