Whatever message this page gives is out now! Go check it out!

Logging

Last update:
May 18, 2026
Handle structured log events from remote MCP server.
Logging allows the MCP server to ship structured log events back to the client. This is useful when:
  • The MCP server is remote and you do not have direct log access
  • You want to surface MCP-related logs in your existing logging system
  • You need to diagnose failures in tool calls or resource reads
Attach a loggingConsumer to your client config; the client calls it whenever the server emits logs.
  1. Define your logging handler function.
    ADDITIONAL INFORMATION:

<cfscript>

function myLoggingHandler(loggingMessage) {

    var level = loggingMessage.level;
    var data  = loggingMessage.data;

    writeLog(type=level, text=data);

    return "Log received";
}

</cfscript>
                    
  1. Configure MCP client with the logging handler.
    ADDITIONAL INFORMATION:

<cfscript>

configData = {

    transport: { /* transport config */ },

    loggingConsumer: myLoggingHandler
};

mcpClient = MCPClient(configData);

</cfscript>
                    
Result
Your MCP client now receives and processes structured server logs.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page