-
Notifications
You must be signed in to change notification settings - Fork 11
Implement unified logger with log level - part 1 #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| // Initialize logger | ||
| log := logger.New(cfg.LogLevel, cfg.LogFormat, os.Stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially we can set the level, format and the output stream, as long as it implements the io.Writer interface.
…fied-logger-for-MCP
| }) | ||
|
|
||
| t.Run("all log levels can be set dynamically", func(t *testing.T) { | ||
| levels := []string{"debug", "info", "notice", "warn", "warning", "error", "critical", "alert", "emergency"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably won't need this many levels, but it's in the spec https://modelcontextprotocol.io/specification/draft/server/utilities/logging#log-levels
| Params := args.Params | ||
|
|
||
| log.Printf("cypher-query: %s", Query) | ||
| deps.Log.Info("executing read cypher query", "query", Query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep this as a debug instead, but VSCode MCP client is setting the log level to Info and I could not find a way to change that. Not sure if we want cypher queries to be logged all the time?
Introduce a logging service to enhance error handling and debugging capabilities across various components of the application. Update configuration to include log level and format, and ensure that logging is integrated into the server and tool dependencies.
WIP: only integrated for the get-schema tool for now. Tests to follow.
Part 1: (in this PR)
logger only implemented for the get-schema tool for nowimplemented for all toolsPart 2: (not in this PR)
https://linear.app/neo4j/issue/DEVSURF-806/design-and-create-logger-to-handle-logging-in-the-mcp-server