🔥 Bunyan Gelf Rest
Bunyan stream to send logs in GELF format to Greylog by using REST API
Installation
With yarn:
yarn add @sincrolab/bunyan-gelf-rest
With npm:
npm install @sincrolab/bunyan-gelf-rest
Example
For more information about bunyan streams read the official bunyan documentation.
const bunyan = require('bunyan')
const { BunyanGelfRest } = require('@sincrolab/bunyan-gelf-rest')
const streams = [
{
type: 'raw',
stream: new BunyanGelfRest({
host: 'https://log-service.com',
port: 9999, // optional (default 443)
path: '/gelf' // optional (default '/')
})
}
]
const Logger = bunyan.createLogger({
name: 'myapp',
streams,
serializers: bunyan.stdSerializers
})
module.exports = Logger