@farmersdog/bunyan-syslog

1.0.1 • Public • Published

bunyan-syslog is a stream for bunyan that consumes raw records from bunyan and sends them to a remote syslog server.

Installation

npm install -S @farmersdog/bunyan-syslog

About

This fork is compliant with RFC 5424. It supports Structured Data component in messages as well as TLS over TCP.

Local syslog bindings have been removed.

Usage

var bunyan = require('bunyan');
var bsyslog = require('bunyan-syslog');

var log = bunyan.createLogger({
  name: 'foo',
  streams: [{
    level: 'debug',
    type: 'raw',
    stream: bsyslog.createBunyanStream({
      type: 'tcp',
      tls: true,
      data: '[structured data]'
      facility: bsyslog.local0,
      host: '192.168.0.1',
      port: 514
    })
  }]
});

log.debug({ foo: 'bar' }, 'hello %s', 'world');

That's pretty much it. You create a syslog stream, and point it at a syslog server (UDP by default; you can use TCP by setting type: tcp in the constructor).

Note you must pass type: 'raw' to bunyan in the top-level stream object or this won't work.

Mappings

This module maps bunyan levels to syslog levels as follows:

+--------+--------+
| Bunyan | Syslog |
+--------+--------+
| fatal  | emerg  |
+--------+--------+
| error  | error  |
+--------+--------+
| warn   | warn   |
+--------+--------+
| info   | info   |
+--------+--------+
| *      | debug  |
+--------+--------+

License

MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i @farmersdog/bunyan-syslog

Weekly Downloads

39

Version

1.0.1

License

MIT

Unpacked Size

11.6 kB

Total Files

7

Last publish

Collaborators

  • samkim130
  • xianlin-tfd
  • mdelorenzitfd
  • qzhangtfd
  • spoch
  • mtyberg
  • mneary
  • kevinchitfd
  • lijintai09
  • jsessions
  • notwella
  • dquackenbos
  • jshah1
  • ryscottcam
  • dustintfd
  • esnover
  • jpitkofskytfd
  • druserkes
  • wrosenthal
  • raftfd
  • yockeytfd
  • hathwal
  • arosalestfd
  • nbrowning-tfd
  • antontfd
  • ifollett
  • gmartinez
  • ankitbrana
  • cplummer
  • lmommaerts_tfd
  • awitzeltfd
  • gwalls89-tfd
  • tobicorradi
  • olaldetomas
  • juanfopaez
  • zrolstontfd
  • rnguyen-tfd
  • lclarketfd
  • goyalmanuj12
  • theclegginator
  • armandomota
  • wjessen
  • ncastello
  • gpbl
  • mattdiamond
  • njmyers
  • rwolfe
  • mkuritz1
  • rfittonczh
  • dorothy_tfd
  • izzie1349
  • jamesball27
  • mjbeaumont
  • nathanielcmoon
  • urvesh
  • vacas_tfd
  • bkilloran-tfd
  • keiyng_tfd
  • thefarmersdog
  • gcampbell-13
  • zdixontfd