Skip to content

valeryq/bunyan-gelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bunyan-gelf

npm package npm downloads

Bunyan stream to send logs in GELF format to GELF related log collecting services).

Installation

With yarn:

yarn add bunyan-gelf

With npm:

npm install bunyan-gelf

Example

For more information about bunyan streams read the official bunyan documentation.

const bunyan = require('bunyan');
const BunyanToGelfStream = require('bunyan-gelf');

const streams = [{
 type: 'raw',
 stream: new BunyanToGelfStream({
   host: 'log-service.example', // GELF related service url (without any protocol)
   port: 9999,
   protocol: 'tcp', // Supported: 'tcp' and 'udp' (default: 'udp')
 }),
}];

const Logger = bunyan.createLogger({
  name: 'myapp',
  streams,
  serializers: bunyan.stdSerializers,
});

module.exports = Logger;

About

Bunyan logs to GELF throught UDP socket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •