Socket
Socket
Sign inDemoInstall

bunyan-amqp-logger

Package Overview
Dependencies
25
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunyan-amqp-logger

AMQP stream for the Bunyan logger


Version published
Weekly downloads
84
increased by50%
Maintainers
1
Install size
1.90 MB
Created
Weekly downloads
 

Readme

Source

AMQP stream for Bunyan

Build Status

AMQP stream for the Bunyan logger

Installation

$ npm install bunyan-amqp-logger

Usage

"use strict";

var bunyan = require('bunyan');
var bunyanamqp = require('bunyan-amqp-logger');

var amq_stream = bunyanamqp.createStream({
    login : 'admin',
    password : 'UbpdMksr0ons',
    exchange : {
        routingKey : 'logs'
    }
}).on('connect', function () {
    console.log("Connected to amqp");
}).on('close', function (e) {
    console.log("Closed connection to amqp");
}).on('error', console.log);


var log = bunyan.createLogger({
    name : 'example',
    streams : [{
        level : 'debug',
        stream : process.stdout
    }, {
        level : 'debug',
        type : 'raw',
        stream : amq_stream
    }]
});

Configuration

A raw bunyan stream can be created using the module createStream(options)method.

The options object accepts the following fields:

ParameterTypeDefaultDescription
hoststringlocalhostAMQP host
portnumber5672AMQP port
vhoststring/AMQP virtual host
loginstringguestAMQP username
passwordstringguestAMQP password
sslEnablebooleanfalseEnable AMQP SSL
sslKeystring''AMQP SSL private key file path
sslCertstring''AMQP SSL certificate file path
sslCAstring''AMQP SSL CA file path
sslRejectUnauthorizedbooleantrueVerify AMQP SSL certificate against CA
exchangeobjectundefinedAMQP exchange options
levelstringinfoMessage level
serverstringos.hostname()Message source server
applicationstringprocess.titleMessage source application
pidstringprocess.pidMessage pid
tagsstring array["bunyan"]Message tags
typestringundefinedMessage type
bufferSizenumber100Outstanding message buffer size
messageFormatterfunctionundefinedOptional message formatting function

The exchange object accepts the following fields:

ParameterTypeDefaultDescription
namestringundefinedAMQP exchange name
routingKeystringmessage.levelAMQP message routing key
propertiesobject{}AMQP exchange options

Events

The stream will emit open, close and error events from the underlying AMQP connection.

Credits

This module is heavily based on bunyan-logstash-amqp.

Keywords

FAQs

Last updated on 14 Nov 2018

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