Commit 9ba869a7 authored by Kelvin Fichter's avatar Kelvin Fichter

feat(cmn): BSV2 server logs to logger

Sends BSV2 server logs to this.logger instead of stdout.
parent d1c24a9a
---
'@eth-optimism/common-ts': patch
---
Log server messages to logger instead of stdout
......@@ -375,7 +375,17 @@ export abstract class BaseServiceV2<
app.use(bodyParser.urlencoded({ extended: true }))
// Logging.
app.use(morgan('short'))
app.use(
morgan('short', {
stream: {
write: (str: string) => {
this.logger.info(`server log`, {
log: str,
})
},
},
})
)
// Metrics.
// Will expose a /metrics endpoint by default.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment