1.0.1 • Published 4 years ago

@blackspark/seneca-pino-logger v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Seneca

A Seneca.js logger for Pino

seneca-pino-logger

npm version Build Status Dependency Status Coveralls Gitter

This module is a plugin that enables your Seneca-based microservice use Pino as a logger.

Seneca compatibility

Supports Seneca versions 3.x

Getting Started

This logger can be used in two ways:

  • Passing an instance of Pino
  • Passing the configuration to create an instance

Here is an example on how to use the logger passing an existing instance:

var Seneca = require('seneca')

var Pino = require('pino')
var pino = Pino()
var config = {legacy: {logging: false}, 'pino-logger': {instance: pino}}

var seneca = Seneca(config)

seneca.use('./pino')

And here is one example on how to use the logger passing the configuration:

var Seneca = require('seneca')

var Pino = require('pino')
var pino = Pino()
var config = {legacy: {logging: false}, 'pino-logger': {config: {extreme: true}}}

var seneca = Seneca(config)

seneca.use('./pino')

And that's all!

Configuration

In order to configure the logger there is a number of configuration parameters that can be passed into Seneca in the key 'pino-logger'.

Those parameters are defined by Pino.

Compatibility

seneca-pino-logger is only compatible with Seneca 3.0+ and Node 4.x+

Contributing

The Senecajs org encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

License

Copyright (c) 2016, David Gonzalez and other contributors. Licensed under MIT.

1.0.1

4 years ago