Bunyan Syslog Unix Datagram
A syslog stream for bunyan that works without requiring any configuration to the syslog daemon.
In most UNIX systems, syslog is automatically configured to be listening at a UNIX datagram domain socket (most likely /var/log), so any messages sent there will be logged by syslog. This stream connects to datagram domain sockets, so unlike other bunyan syslog stream implementations, you won't have to go and change your syslog config file to enable a TCP/UDP server.
It just works, which makes it easier to use for beginners.
Installation
npm install bunyan-syslog-unixdgram
Usage
var bunyan = ;var SyslogStream = ; var stream = name: 'myAppName' facility: SyslogStreamfacilitylocal6 path: '/dev/log'; var log = bunyan; log;
Stream Options
An options object can be provided when instantiating the stream object. It can contain the following properties:
- name: name that is used in the tag portion of the syslog log messages header. Defaults to process.title || process.argv[0].
- facility: syslog facility for the log messages. Defaults to 1 (user facility).
- path: The path to the UNIX datagram domain socket to which the log messages will be sent. Defaults to /dev/log.
Mappings
This module maps bunyan levels to syslog levels as follows:
+--------+--------+
| Bunyan | Syslog |
+--------+--------+
| fatal | emerg |
+--------+--------+
| error | error |
+--------+--------+
| warn | warn |
+--------+--------+
| info | info |
+--------+--------+
| * | debug |
+--------+--------+
License
MIT.