logger-one

Logger middleware for express

Usage no npm install needed!

<script type="module">
  import loggerOne from 'https://cdn.skypack.dev/logger-one';
</script>

README

logger-one

NPM

A simple but efficient logging middleware for express.js

Installation

npm install logger-one

API

var loggerOne = require('logger-one')

There are two different ways to use logger-one :

Simple Usage

app.use(loggerOne());

With options

app.use(loggerOne({
    request:true,
    requestData:{
        headers:false,
        body:true,
        params:true,
        query:true
    },
    response:true,
    responseData:{
        status:true,
        body:true,
        responseTime:false
    }
}));

Note :

  • looger-one middleware must be loaded only after body-parser has been used
  • All the initialisation parameters are optional and by default are set true

Version 1.1.3 :

AUTHOR

Tabish Rizvi (sayyidtabish@gmail.com)

LICENSE

MIT