1.0.0 • Published 3 years ago

etlogger-syslog-handler v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

ET Logger Syslog Handler

This handler will send logger output to syslog using modern-syslog. That package uses native C bindings to the host syslog library, which is good for performance, but of course you're going to need build tools to install it which may or may not be ideal.

It logs to the local syslog daemon which can then do other things with the message as appropriate and based on it's configuration. So if you're not seeing output, you may want to check that.

Usage

See the example in ./example.js

const Log = require("etlogger"); 
const SyslogHandler = require("etlogger-syslog-handler");

// The opts object is optional
const opts = {
    ident: "MyApp", // defaults to process.title which is probably just `node`
    flags: SyslogHandler.flag.LOG_ID || SyslogHandler.flag.LOG_PERROR,  // An or'd set of values
    facility: SyslogHandler.facility.LOG_DAEMON, // defaults to LOG_LOCAL0
};
const handler = new SyslogHandler(opts);

Log.addLogHandler(handler);

Log.debug("This is a %s message", "debug");

Flags and facilities

See https://github.com/strongloop/modern-syslog for inherited values.

1.0.0

3 years ago

0.1.0

3 years ago