TsgcWSAPIServer_MCPMethods › SendLogMessage

SendLogMessage Method

Sends a notifications/message log entry to every session whose logging level allows it.

Syntax

procedure SendLogMessage(aLevel: TsgcAI_MCP_LoggingLevel; const aLogger, aData: string);

Parameters

NameTypeDescription
aLevelTsgcAI_MCP_LoggingLevelRFC 5424 severity of the entry (debug, info, notice, warning, error, critical, alert, emergency).
aLoggerconst stringOptional logger name identifying the component that produced the message.
aDataconst stringFree-form payload (plain text or JSON) delivered to the client as the message body.

Remarks

Fans out a notifications/message entry to every open session whose current logging level (set by the client through logging/setLevel) is at or below aLevel. The notification is only emitted when TransportOptions.HttpStreamable.Enabled is True; short-lived HTTP clients do not receive asynchronous logs. Sessions that opted into a higher severity threshold will silently discard lower-priority entries.

Example

MCPServer.SendLogMessage(aimcpllInfo, 'ops', 'Deployment 42 rolled back successfully.');

Back to Methods