This package provides a pino mixin for setting the correlation id property on the log event.
npm i @totalsoft/pino-correlation
or
yarn add @totalsoft/pino-correlation
const { correlationMixin } = require('@totalsoft/pino-correlation');
import { pino } from 'pino'
const options = {
mixin(_context, _level) {
return correlationMixin()
}
}
const logger = pino(options);