serverlog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 12 Imported by: 0

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