From 01eeaf86b9b71590dee19801a926a0816d393aff Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Thu, 21 Nov 2024 22:39:58 +0000 Subject: [PATCH] Fix SQLite server logging to file --- src/sqlite/pyproject.toml | 2 +- src/sqlite/src/mcp_server_sqlite/server.py | 8 +------- src/sqlite/uv.lock | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/sqlite/pyproject.toml b/src/sqlite/pyproject.toml index 8944fb4e..5166a05b 100644 --- a/src/sqlite/pyproject.toml +++ b/src/sqlite/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcp-server-sqlite" -version = "0.3.0" +version = "0.3.1" description = "A simple SQLite MCP server" readme = "README.md" requires-python = ">=3.11" diff --git a/src/sqlite/src/mcp_server_sqlite/server.py b/src/sqlite/src/mcp_server_sqlite/server.py index 6124dcae..257715d5 100644 --- a/src/sqlite/src/mcp_server_sqlite/server.py +++ b/src/sqlite/src/mcp_server_sqlite/server.py @@ -10,14 +10,8 @@ from pydantic import AnyUrl from typing import Any -# Set up logging to file -log_file = Path('mcp_server.log') -handler = RotatingFileHandler(log_file, maxBytes=10*1024*1024, backupCount=5) -formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') -handler.setFormatter(formatter) +logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger('mcp_sqlite_server') -logger.setLevel(logging.DEBUG) -logger.addHandler(handler) logger.info("Starting MCP SQLite Server") PROMPT_TEMPLATE = """ diff --git a/src/sqlite/uv.lock b/src/sqlite/uv.lock index b290984a..9a3fa80b 100644 --- a/src/sqlite/uv.lock +++ b/src/sqlite/uv.lock @@ -128,7 +128,7 @@ wheels = [ [[package]] name = "mcp-server-sqlite" -version = "0.1.0" +version = "0.3.0" source = { editable = "." } dependencies = [ { name = "mcp" },