Provides ways to wrap a route or request-response handler in a new handler which also streams pairs of enriched request and response to an access log sink:
Provides ways to wrap a route or request-response handler in a new handler which also streams pairs of enriched request and response to an access log sink:
+------------------------------------------------------------------------------------+ | | | +-----------+ +-----------+ +-----------+ +-----------+ | | +--->○ enrichReq ○----->○ unzip ○----->○ handler ○----->○ bcastRes ○--+ | | | +-----------+ +-----○-----+ +-----------+ +-----------+ | | | | | | | | ○---+ | | +-->○ | v | | | +-----------+ +-----○-----+ | | | | accessLog ○<-----○ zip ○<------------------------------+ | | +-----------+ +-----------+ | | | +------------------------------------------------------------------------------------+
Example:
import Accessus._ Http().bindAndHandle( route.withAccessLog(Sink.foreach { case ((req, t), res) => ??? }), "0.0.0.0", 8000 )