feat: add read/written bytes to logs
This commit is contained in:
parent
d64c4a4df6
commit
2e4eb9a2e7
1 changed files with 4 additions and 1 deletions
|
|
@ -56,7 +56,10 @@ app.use(compression({ threshold: 500 }))
|
|||
app.use(helmet())
|
||||
app.use(nocache())
|
||||
app.use(express.json({ limit: '2mb' }))
|
||||
app.use(morgan(':method :url :status :response-time ms -- :req[content-length]/:res[content-length] b', { stream: logger.stream }))
|
||||
|
||||
morgan.token('bytesRead', (_req, res) => res.bytesRead)
|
||||
morgan.token('bytesWritten', (_req, res) => res.bytesWritten)
|
||||
app.use(morgan(':method :url :status :response-time ms -- :bytesRead/:bytesWritten B', { stream: logger.stream }))
|
||||
|
||||
// app /pair and /ca routes
|
||||
app.use('/', pairingRoutes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue