1.1.0 • Published 2 years ago

@totalsoft/pino-correlation v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pino-correlation

This package provides a pino mixin for setting the correlation id property on the log event.

Installation

npm i @totalsoft/pino-correlation

or

yarn add @totalsoft/pino-correlation

Usage

const { correlationMixin } = require('@totalsoft/pino-correlation');
import { pino } from 'pino'

const options = {
  mixin(_context, _level) {
    return correlationMixin()
  }
}

const logger = pino(options);