How to use the pino-multi-stream.multistream function in pino-multi-stream

To help you get started, we’ve selected a few pino-multi-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github easy-mock / easy-mock / util / logger.js View on Github external
/* istanbul ignore if */
if (process.env.NODE_ENV === 'production') {
  if (!fs.existsSync(logDir)) mkdirp.sync(logDir)

  streams = [
    {level: 'info', stream: fs.createWriteStream(`logs/${date}-info.log`, streamOpt)},
    {level: 'error', stream: fs.createWriteStream(`logs/${date}-error.log`, streamOpt)}
  ]
}

module.exports = koaPinoLogger({
  name: 'Easy Mock',
  level: process.env.NODE_ENV === 'test' ? 'silent' : /* istanbul ignore next */ 'info',
  genReqId: req => req.headers['x-request-id'] || uuid.v4()
}, multistream(streams))
github ethereum-optimism / optimism / packages / core-utils / src / common / logger.ts View on Github external
base: null,
    }

    let loggerStreams: Streams = [{ stream: process.stdout }]
    if (options.sentryOptions) {
      loggerStreams.push({
        level: 'error',
        stream: createWriteStream({
          ...options.sentryOptions,
          stackAttributeKey: 'err',
        }),
      })
    }
    if (options.streams) loggerStreams = loggerStreams.concat(options.streams)

    this.inner = pino(loggerOptions, pinoms.multistream(loggerStreams))
  }
github paritytech / fether / packages / fether-electron / src / main / app / utils / pino.js View on Github external
export default opts => Pino({ name, ...opts }, multistream(streams));

pino-multi-stream

A wrapper for the Pino logger that provides Bunyan's multipe destination stream API

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis