Backend (/api) logging configuration
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
We should write some utilities to abstract logging. Probably use eslint to error on direct `console.log` usage after that (can still be encouraged for dev/test logs, the point would be to make sure they're cleaned up pre-merge).
In dev, we want well formated plain text console output. Mainly error messages and call stack information.
In test, we'll probably want to sinkhole console output (by default). It clutters up jest's report output.
In prod, we want nice structured logs (json) with lots of additional info (user session id, pod details, etc). Ideally logging to the console _asynchronously_ for performance. [Winston](https://www.npmjs.com/package/winston) seems like a fully featured option, though at first glance of the docs I couldn't see anything about proper async console logging. [Pino](https://www.npmjs.com/package/pino) has a clearly documented [asynchronous mode](https://github.com/pinojs/pino/blob/HEAD/docs/asynchronous.md).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.