@logone/express
v0.0.4
Published
This library is logger that supports structured logging by generating a single line of JSON format for your specified lifecycle. Inspired by logone-go.
Downloads
384
Readme
@logone/express
Middleware that using logone on express.
Installation
npm install @logone/express
Usage
import logone from '@logone/express'
app.use(logone())
app.use((req, res, next) => {
req.logger.info('prepare')
next()
})
app.use((error, req, res, next) => {
req.logger.error(error)
res.send(500)
})
app.get('/example', (req, res) => {
req.logger.info('hello')
res.send(200)
})