You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Call the tool that can sends logging notifications
234
+
CallToolResult result = mcpClient.callTool(newMcpSchema.CallToolRequest("logging-test", Map.of()));
235
+
```
236
+
Clients can control the minimum logging level they receive through the `mcpClient.setLoggingLevel(level)` request. Messages below the set level will be filtered out.
237
+
Supported logging levels (in order of increasing severity): DEBUG (0), INFO (1), NOTICE (2), WARNING (3), ERROR (4), CRITICAL (5), ALERT (6), EMERGENCY (7)
exchange.loggingNotification( // Use the exchange to send log messages
546
+
McpSchema.LoggingMessageNotification.builder()
547
+
.level(McpSchema.LoggingLevel.DEBUG)
548
+
.logger("test-logger")
549
+
.data("Debug message")
550
+
.build())
551
+
.block();
552
+
553
+
returnMono.just(newCallToolResult("Logging test completed", false));
554
+
});
555
+
556
+
var mcpServer =McpServer.async(mcpServerTransportProvider)
557
+
.serverInfo("test-server", "1.0.0")
558
+
.capabilities(
559
+
ServerCapabilities.builder()
560
+
.logging() // Enable logging support
561
+
.tools(true)
562
+
.build())
563
+
.tools(tool)
564
+
.build();
565
+
```
566
+
567
+
Clients can control the minimum logging level they receive through the `mcpClient.setLoggingLevel(level)` request. Messages below the set level will be filtered out.
568
+
Supported logging levels (in order of increasing severity): DEBUG (0), INFO (1), NOTICE (2), WARNING (3), ERROR (4), CRITICAL (5), ALERT (6), EMERGENCY (7)
0 commit comments