Giter Club home page Giter Club logo

rsyslog's Introduction

rsyslog

Sprays packets to a remote RFC5424 syslog, e.g. at Papertrail

Relying on the defaults:

const { RemoteSyslog, SEVERITY } = require('rsyslog');
const rsyslog = new RemoteSyslog();
rsyslog.once('error', err => { /* catch it, or Node will crash */ });
rsyslog.send(SEVERITY.NOTICE, "I'm awake!");

Specifying the results in full detail:

const { RemoteSyslog, FACILITY, SEVERITY, NILVALUE } = require('rsyslog');
const os = require('os');
const rsyslog = new RemoteSyslog({
    target_host: '127.0.0.1', // syslog server's hostname
    target_port: 514, // syslog server's port
    hostname: os.hostname(), // sender's hostname
    facility: FACILITY.local0, // 'local0' would also do
    appname: NILVALUE,
    procid: process.pid,
});
rsyslog.once('error', err => { /* catch it, or Node will crash */ });
rsyslog.send(SEVERITY.NOTICE, "I'm awake!", {
    timestamp: Date.now(),
    syslog_msgid: NILVALUE,
});

RFC5424 Details

  • All HEADER fields get reasonable defaults
  • The MSG is always UTF-8 encoded
  • STRUCTURED-DATA is not yet supported
  • You should read the section on message length
  • FACILITY, SEVERITY, and NILVALUE are exported for your convenience

Change Log

1.1.1: fix scheduling problem revealed by buf.byteLength crasher

1.1.0: fix awful spec violation (missing STRUCTURED-DATA); add procid option

rsyslog's People

Contributors

garthk avatar

Watchers

 avatar  avatar

Forkers

suranyami

rsyslog's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.