0.2.2 • Published 3 years ago

@taotiejs/http v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Taotie HTTP

npm npm downloads license

github

HTTP logger of Taotie, base on pino-http.

It outputs meaningful log message:

GET /api 200 10ms

Installation

npm install @taotiejs/http

Usage

All usages as same as pino-http.

More Options

customLogFormatter

options.customLogFormatter = function(req, res) {
  return [{
    res,
    responseTime: res.responseTime,
  }, `${req.method} ${req.url} ${res.statusCode} ${res.responseTime}ms`]
}

Server

You may use @taotiejs/server for log collecting and querying.