A Seneca.js logger for Pino
- Lead Maintainer: David Gonzalez
- Sponsor: nearForm
- node: 4.x, 6.x
This module is a plugin that enables your Seneca-based microservice use Pino as a logger.
Supports Seneca versions 3.x
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!
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.
seneca-pino-logger is only compatible with Seneca 3.0+ and Node 4.x+
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.
Copyright (c) 2016, David Gonzalez and other contributors. Licensed under MIT.