July 2017
Intermediate to advanced
656 pages
16h 1m
English
In Chapter 1, Debugging processes we discussed the debug module, which is used to conditionally output debug logs based on namespaces defined on the DEBUG variable. Both Express and Koa (and the dependencies they use) use the debug module heavily.
The pino-debug module can hook into the debug logs, and wrap them in JSON logs, all while logging at 10 times the speed of the debug module. This affords us the opportunity of high resolution production logging.
Let's check it out copying our express-logging folder from the main recipe, saving it as express-pino-debug-logging and installing pino-debug:
$ cp -fr express-logging express-pino-debug-logging $ cd express-pino-debug-logging $ npm install --save pino-debug ...