Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt

Use this file to discover all available pages before exploring further.

Logging Middleware

PrismLoggingMiddleware prints a log line for every request, including the HTTP method, path, status code, and response time.

Setup

Enable Logging
await server.use(PrismLoggingMiddleware())
Output:
GET /api/users → 200 OK (2.3ms)
POST /api/users → 201 Created (15.1ms)
GET /api/users/999 → 404 Not Found (0.8ms)

Combine with Tracing

For production, pair logging with request tracing so every log line includes a unique request ID:
Traced Logging
await server.use(PrismTracingMiddleware())
await server.use(PrismLoggingMiddleware())
Add logging middleware early in the stack to capture timing for the entire request lifecycle, including other middleware execution.