Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 617 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 617 Bytes

@qiwi/mware-logger

Request/response logger middleware

Install

yarn add @qiwi/mware-logger
npm i @qiwi/mware-logger

Usage

import logger from '@qiwi/mware-logger'
import express from 'express'

const app = express()
app.use(logger())

app.get('/foo/bar', (req, res) => res.status(503).send('foobar'))
// REQ 1f2146c00726d6f3 > method=GET target=/foo/bar origin=example.com ip=10.10.10.10 headers={\"origin\":\"example.com\",\"host\":null}
// RES ccb0fa3f9c8f5afc method=GET target=/foo/bar < status=503 duration=1ms headers={} bufferLength=6

app.listen(...)

License

MIT