From b5297cb947b83a45165c881d064db865311eaaa5 Mon Sep 17 00:00:00 2001 From: Karl Weinmeister Date: Sat, 18 Oct 2025 07:31:20 -0500 Subject: [PATCH] feat: add configuration option for log file path --- README.md | 1 + src/utils/logger.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 819373e..07ceca0 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,7 @@ For VS Code MCP extension, add to your settings: |----------|---------|-------------| | `EXPRESS_SERVER_URL` | `http://localhost:3000` | Canvas server URL for MCP sync | | `ENABLE_CANVAS_SYNC` | `true` | Enable/disable canvas synchronization | +| `LOG_FILE_PATH` | `excalidraw.log` | Path to the log file | | `DEBUG` | `false` | Enable debug logging | | `PORT` | `3000` | Canvas server port | | `HOST` | `localhost` | Canvas server host | diff --git a/src/utils/logger.ts b/src/utils/logger.ts index b5e6562..6a89752 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,5 +1,7 @@ import winston from 'winston'; +const LOG_FILE_PATH = process.env.LOG_FILE_PATH || 'excalidraw.log'; + const logger: winston.Logger = winston.createLogger({ level: process.env.LOG_LEVEL || 'info', @@ -18,7 +20,7 @@ const logger: winston.Logger = winston.createLogger({ }), new winston.transports.File({ - filename: 'excalidraw.log', // all levels to file + filename: LOG_FILE_PATH, // all levels to file level: 'debug' }) ]