fast-twitch.middlewares.logging
Complete generated reference for fast-twitch.middlewares.logging
Usage and execution boundary
Emits a completion event through a logger when the response is available. This is not continuous stream-progress logging. Promise/callback completion is handled through the corresponding handler contract.
(ns application.middleware
(:require [fast-twitch.middlewares.logging :as middleware]))
(defn handler [_]
{:status 200 :headers {"content-type" "text/plain"} :body "Hello"})
(def app (middleware/wrap-logging handler))
This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.
Settings and defaults
| Setting | Meaning |
|---|---|
:logger |
Function receiving the event; default console logger |
:event-fn |
Function [request response started-at] constructing the logged event |
Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.
Upstream function reference
Emits request logs through a configurable logger hook.
default-logger
(default-logger event)
Function.
Logs request events to console.log. Source
log-response
(log-response response request started-at options)
Function.
Invokes the configured logger for a request/response pair. Source
request-event
(request-event request response started-at)
Function.
Builds the structured log event for a completed request. Source
wrap-logging
(wrap-logging handler)
(wrap-logging handler options)
Function.
Wraps a handler with structured completion logging. Source