npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bunyan-amqp-logger

v1.2.0

Published

AMQP stream for the Bunyan logger

Downloads

425

Readme

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:

| Parameter | Type | Default | Description | | ------------- |:-------------:| -----:|-----:| | host | string | localhost | AMQP host | | port | number | 5672 | AMQP port | | vhost | string | / | AMQP virtual host | | login | string | guest | AMQP username | | password | string | guest | AMQP password | | sslEnable | boolean | false | Enable AMQP SSL | | sslKey | string | '' | AMQP SSL private key file path | | sslCert | string | '' | AMQP SSL certificate file path | | sslCA | string | '' | AMQP SSL CA file path | | sslRejectUnauthorized | boolean | true | Verify AMQP SSL certificate against CA | | exchange | object | undefined | AMQP exchange options | | level | string | info | Message level | | server | string | os.hostname() | Message source server | | application | string | process.title | Message source application | | pid | string | process.pid | Message pid | | tags | string array | ["bunyan"] | Message tags | | type | string | undefined | Message type | | bufferSize | number | 100 | Outstanding message buffer size | | messageFormatter | function | undefined | Optional message formatting function |

The exchange object accepts the following fields:

| Parameter | Type | Default | Description | | ------------- |:-------------:| -----:|-----:| | name | string | undefined | AMQP exchange name | | routingKey | string | message.level | AMQP message routing key | | properties | object | {} | 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.