@mobicom/log-handler
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @mobicom/log-handler

Weekly Downloads

1

Version

1.0.10

License

ISC

Unpacked Size

93.6 kB

Total Files

32

Last publish

Collaborators

  • oyunbold.bmobi
  • gantogtokh.e
  • usukhbayar.ge
  • mendee
  • togtokh