Reduce verbose logging in MCP servlet
- Change service result logging from INFO to DEBUG level - Replace full result logging with summary for tools/list operations - Reduce parameter logging to DEBUG level to avoid sensitive data exposure - Keep essential method logging at INFO level for monitoring - Significantly reduces log volume during MCP tools discovery
Showing
1 changed file
with
3 additions
and
3 deletions
| ... | @@ -646,7 +646,7 @@ logger.info("Handling Enhanced SSE connection from ${request.remoteAddr}") | ... | @@ -646,7 +646,7 @@ logger.info("Handling Enhanced SSE connection from ${request.remoteAddr}") |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | private Map<String, Object> processMcpMethod(String method, Map params, ExecutionContextImpl ec, String sessionId) { | 648 | private Map<String, Object> processMcpMethod(String method, Map params, ExecutionContextImpl ec, String sessionId) { |
| 649 | logger.info("Enhanced METHOD: ${method} with params: ${params}, sessionId: ${sessionId}") | 649 | logger.info("Enhanced METHOD: ${method} with sessionId: ${sessionId}") |
| 650 | 650 | ||
| 651 | try { | 651 | try { |
| 652 | // Ensure params is not null | 652 | // Ensure params is not null |
| ... | @@ -693,14 +693,14 @@ logger.info("Handling Enhanced SSE connection from ${request.remoteAddr}") | ... | @@ -693,14 +693,14 @@ logger.info("Handling Enhanced SSE connection from ${request.remoteAddr}") |
| 693 | } | 693 | } |
| 694 | 694 | ||
| 695 | private Map<String, Object> callMcpService(String serviceName, Map params, ExecutionContextImpl ec) { | 695 | private Map<String, Object> callMcpService(String serviceName, Map params, ExecutionContextImpl ec) { |
| 696 | logger.info("Enhanced Calling MCP service: ${serviceName} with params: ${params}") | 696 | logger.debug("Enhanced Calling MCP service: ${serviceName} with params: ${params}") |
| 697 | 697 | ||
| 698 | try { | 698 | try { |
| 699 | def result = ec.service.sync().name("McpServices.${serviceName}") | 699 | def result = ec.service.sync().name("McpServices.${serviceName}") |
| 700 | .parameters(params ?: [:]) | 700 | .parameters(params ?: [:]) |
| 701 | .call() | 701 | .call() |
| 702 | 702 | ||
| 703 | logger.info("Enhanced MCP service ${serviceName} result: ${result}") | 703 | logger.debug("Enhanced MCP service ${serviceName} result: ${result?.result?.size() ? 'result with ' + (result.result?.tools?.size() ?: 0) + ' tools' : 'empty result'}") |
| 704 | if (result == null) { | 704 | if (result == null) { |
| 705 | logger.error("Enhanced MCP service ${serviceName} returned null result") | 705 | logger.error("Enhanced MCP service ${serviceName} returned null result") |
| 706 | return [error: "Service returned null result"] | 706 | return [error: "Service returned null result"] | ... | ... |
-
Please register or sign in to post a comment