This log handler lib using winston logging library.
Run yarn add @mobicom/log-handler
command
Run yarn upgrade @mobicom/log-handler
command
const { requestHandler, responseHandler, errorMiddleware, logger } = require("@mobicom/log-handler");
express/connect
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!') })
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)
@Mobicom