zmq-log-sender
v1.2.0
Published
advertise services for zmq-logger
Downloads
5
Readme
Usage
Glossary
Work-in-progress module, not a fully-fledged module (yet), so contributions are warmly welcome! :)
Install dependencies
- libzmq3-dev (on Ubuntu trusty)
- node.js
npm install --save zmq-log-sender
In you logger service
Load the required modules
var logger = require('zmq-log-sender');
var os = require('os');
var ifaces = os.networkInterfaces();
var bonjour = require('bonjour');
Advertise that we want to send logs
bonjour.publish({
name: 'your_unique_sender_name',
type: 'zmq',
port: 1784,
host: ifaces.eth0[0].address
});
It will advertise that we would like to send logs, and any logger service listening will connect to us and do something with it (zmq-logger)
Send logs with
logger('your message');
or
logger('your message', {k1: 'val1', k2: 'val2'});
but it won't work because not implemented yet. But I intend to! just give me some motivation (kind words, beer, whatever)