koa-better-log
Koa middleware logging requests.
Usage
Install:
yarn add koa-better-log
Usage:
;; const app = app;
Output:
curl localhost
Options
pretty
: boolean to enable or disable pretty formatting of duration and size, default istrue
logger
: function to log info with, default isconsole.log
json
: boolean to enable logging as json output, default istrue
logWith
: function receivingctx
as argument and returning additional properties to loginclude
: function receivingctx
as argument and returningbool
indicating whether to do log requestexclude
: function receivingctx
as argument and returningbool
indicating whether to not log request