-
Notifications
You must be signed in to change notification settings - Fork 655
Expand file tree
/
Copy pathLoggingMessageNotificationParams.cs
More file actions
53 lines (49 loc) · 2 KB
/
LoggingMessageNotificationParams.cs
File metadata and controls
53 lines (49 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents the parameters used with a <see cref="NotificationMethods.LoggingMessageNotification"/>
/// notification sent whenever a log message is generated.
/// </summary>
/// <remarks>
/// <para>
/// Logging notifications allow servers to communicate diagnostic information to clients with varying severity levels.
/// Clients can filter these messages based on the <see cref="Level"/> and <see cref="Logger"/> properties.
/// </para>
/// <para>
/// If no <see cref="RequestMethods.LoggingSetLevel"/> request has been sent from the client, the server can decide which
/// messages to send automatically.
/// </para>
/// <para>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </para>
/// </remarks>
public sealed class LoggingMessageNotificationParams : NotificationParams
{
/// <summary>
/// Gets or sets the severity of this log message.
/// </summary>
[JsonPropertyName("level")]
public required LoggingLevel Level { get; set; }
/// <summary>
/// Gets or sets an optional name of the logger issuing this message.
/// </summary>
/// <remarks>
/// <para>
/// <see cref="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.
/// </para>
/// <para>
/// When implementing custom servers, choose clear, hierarchical logger names to help
/// clients understand the source of log messages.
/// </para>
/// </remarks>
[JsonPropertyName("logger")]
public string? Logger { get; set; }
/// <summary>
/// Gets or sets the data to be logged, such as a string message or an object.
/// Any JSON serializable type is allowed here.
/// </summary>
[JsonPropertyName("data")]
public required JsonElement Data { get; set; }
}