serverlog

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package serverlog provides the deliberately narrow logging surface used by the self-hosted HTTP server.

Index

Constants

View Source
const LevelTrace = slog.LevelDebug - 4

LevelTrace is the most verbose server log level.

View Source
const RequestIDHeader = "X-Request-Id"

Variables

This section is empty.

Functions

func HTTPMiddleware

func HTTPMiddleware(
	logger *slog.Logger,
	transport string,
	path func(*http.Request) string,
	next http.Handler,
) http.Handler

HTTPMiddleware logs safe request lifecycle metadata.

func New

func New(writer io.Writer, level slog.Level) *slog.Logger

New constructs the text logger used by airplan serve.

func ParseLevel

func ParseLevel(value string) (slog.Level, error)

ParseLevel parses one documented server log level.

func RequestID

func RequestID(ctx context.Context) string

RequestID returns the constrained request identifier from ctx.

func RequestIDMiddleware

func RequestIDMiddleware(next http.Handler) http.Handler

RequestIDMiddleware ensures each request and response has a safe identifier.

func SafeMCPLogger

func SafeMCPLogger(logger *slog.Logger) *slog.Logger

SafeMCPLogger adapts SDK logs to the server policy. SDK messages and attributes may contain protocol data, so only fixed event categories pass.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL