req-res-logger
v1.0.1
Published
Request|response logger for express app
Downloads
3
Readme
var express = require('express')
var rrlogger = require('req-res-logger');
var app = express()
app.use(rrlogger(function(req, res) {
res.__start = process.hrtime()
},
function (err, req, res) {
var end = process.hrtime(req.__start)
var responseTime = (end[0]*1e9 + end[1])/1e6
console.log('response time', responseTime)
}))
var express = require('express')
var rrlogger = require('req-res-logger');
var app = express()
app.use(rrlogger(function (err, req, res) {
console.log('response status', res.statusCode)
}))