3 ms·
Author here. Yes, my conclusion's a bit blunt. I guess the broader takeaway is to not generate log lines in your business logic but instead to use a common API
by Hedja 8y ago
Author here.
Yes, my conclusion's a bit blunt. I guess the broader takeaway is to not generate log lines in your business logic but instead to use a common API for events so that changing outputs (e.g. to syslog or some other standard) is straight forward, as shown in the example code with the concept of "reporters".
You can also pipe the output from JSON to syslog if format is the main concern and not performance. Like pino-syslog[1] shows.
[1] https://github.com/pinojs/pino-syslog https://github.com/pinojs/pino-syslog