Table of Contents

Class LoggingMessageNotificationParams

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents the parameters used with a LoggingMessageNotification notification sent whenever a log message is generated.

public class LoggingMessageNotificationParams
Inheritance
LoggingMessageNotificationParams
Inherited Members

Remarks

Logging notifications allow servers to communicate diagnostic information to clients with varying severity levels. Clients can filter these messages based on the Level and Logger properties.

If no LoggingSetLevel request has been sent from the client, the server may decide which messages to send automatically.

See the schema for details.

Properties

Data

Gets or sets the data to be logged, such as a string message.

[JsonPropertyName("data")]
public JsonElement? Data { get; init; }

Property Value

JsonElement?

Level

Gets or sets the severity of this log message.

[JsonPropertyName("level")]
public LoggingLevel Level { get; init; }

Property Value

LoggingLevel

Logger

Gets or sets an optional name of the logger issuing this message.

[JsonPropertyName("logger")]
public string? Logger { get; init; }

Property Value

string

Remarks

Logger typically represents a category or component in the server's logging system. The logger name is useful for filtering and routing log messages in client applications.

When implementing custom servers, choose clear, hierarchical logger names to help clients understand the source of log messages.