← Back to ToolBench
Utilities

Logging

Structured log messages from server to client

What it does

The logging utility allows servers to send structured log messages to the client at various severity levels (debug, info, warning, error, etc.). The client can set the minimum log level via logging/setLevel, and the server sends log entries as notifications/message. This provides visibility into server operations for debugging, monitoring, and audit purposes.

How it works

Client Server logging/setLevel {level: "warning"} notifications/message {level, data} notifications/message {level, data}

Example implementation

server.sendLoggingMessage({
  level: "warning",
  logger: "db-connector",
  data: { message: "Connection pool nearing limit", active: 48, max: 50 }
});