howdy/logger
Request logging middleware.
import howdy
import howdy/logger
import logging
logging.configure()
howdy.new()
|> howdy.middleware(logger.log)
Add the logger first to include responses from middleware that rejects requests or answers them directly, such as authentication or CORS. Unmatched routes bypass middleware and are not logged.
Values
pub fn log(
ctx: context.Context(Nil),
next: fn(context.Context(Nil)) -> response.Response(
content.Content,
),
) -> response.Response(content.Content)
Log the method, path and returned status at Info, for example
GET /user/2 -> 200. Returns the response unchanged.
Configure logging in your application’s startup code; this middleware does not change the global logging configuration. Query strings, headers and bodies are not included. If the next handler panics, no entry is logged.