RingoJS

Module middleware/requestlog

Middleware for collecting log messages issued during execution of the current request.

This adds a requestlog property to the application object with an items property. During execution of a request items contains an array containing all the log messages issued for the request. Log messages are represented as arrays in the format [time, level, name, message].

During request execution, the requestlog property also defines a property called start containing the time the execution started.

By default, messages are appended to the response if its Content-Type is text/html. This can be controlled using the app.requestlog.append boolean flag.

Functions


middleware (next, app)

Middleware for collecting log messages issued during execution of the current request.

Parameters

Function next

the wrapped middleware chain

Object app

the Stick Application object

Returns

Function

a JSGI middleware function