Skip to content

Commit

Permalink
Fix SQLite server logging to file
Browse files Browse the repository at this point in the history
  • Loading branch information
jspahrsummers committed Nov 21, 2024
1 parent fe4f568 commit 01eeaf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/sqlite/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 1 addition & 7 deletions src/sqlite/src/mcp_server_sqlite/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 01eeaf8

Please sign in to comment.