@mendee/log-handler
v1.0.33
Published
Http request log handler
Downloads
18
Readme
Http request log handler for node.js
Intro
This log handler lib using winston logging library.
Installation
Run yarn add @mobicom/log-handler
command
Upgrade
Run yarn upgrade @mobicom/log-handler
command
API
const { requestHandler, responseHandler, errorMiddleware, logger } = require("@mobicom/log-handler");
Examples
express/connect
use requestHandler
var express = require('express') var { requestHandler, logger } = require("@mobicom/log-handler");
var app = express()
app.use(requestHandler)
app.get('/', function (req, res) { res.send('hello, world!') })
use requestHandler, responseHandler and errorMiddleware
var express = require('express') var { requestHandler, responseHandler, logger } = require("@mobicom/log-handler");
var app = express()
app.use(requestHandler) app.use(responseHandler)
app.get('/', function (req, res) { res.send('hello, world!') })
app.use(errorMiddleware)
License
@Mobicom