Socket
Socket
Sign inDemoInstall

bunyan-gelf-formatter

Package Overview
Dependencies
25
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunyan-gelf-formatter

[![npm](https://img.shields.io/npm/v/bunyan-gelf-formatter.svg)](https://www.npmjs.com/package/bunyan-gelf-formatter)


Version published
Weekly downloads
20
increased by122.22%
Maintainers
1
Install size
119 kB
Created
Weekly downloads
 

Readme

Source

bunyan-gelf-formatter

npm

Converts buynayn logs to GELF-compatible format.

Unlike other similar packages, bunyan-gelf-formatter doesn't send logs to Gaylog on its own, so it's ideal for usage with centralized log processors like Fluentd.

Raw bunyan logs cannot be processed by Fluentd GELF plugin due to incompatible level field. This package takes care of properly formatting the log level as well as other default GELF fields and flattening the JSON payloads.

Installation

npm i -S bunyan-gelf-formatter

Usage

Add it as a bunyan stream:

const bunyan = require('bunyan')
const { GelfStream } = require('bunyan-gelf-formatter')

const gelfStream = new GelfStream({})
gelfStream.pipe(process.stdout)

const logger = bunyan.createLogger({
    name: 'logger',
    streams: [{ type: 'raw', stream: gelfStream }]
})

Keywords

FAQs

Last updated on 15 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc