
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
bunyan-amqp-logger
Advanced tools
AMQP stream for the Bunyan logger
$ npm install bunyan-amqp-logger
"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
}]
});
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 |
The stream will emit open
, close
and error
events from the underlying AMQP connection.
This module is heavily based on bunyan-logstash-amqp.
FAQs
AMQP stream for the Bunyan logger
We found that bunyan-amqp-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.