GithubHelp home page GithubHelp logo

arzu63 / bunyan-syslog-udp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wikimedia/bunyan-syslog-udp

0.0 0.0 0.0 16 KB

A udp-only syslog stream for bunyan

License: Apache License 2.0

JavaScript 100.00%

bunyan-syslog-udp's Introduction

bunyan-syslog-udp Build Status

A pure-JS implementation of bunyan syslog stream on top of UDP protocol.

Installation

npm install bunyan bunyan-syslog-udp

Verify that syslog via UDP is enabled on your system. By default, the syslog daemon listens on port 514.

In order to take advantage of the @CEE cookie functionality either rsyslog or syslog-ng must be installed.

For rsyslog, make sure the mmjsonparse module is loaded in /etc/rsyslog.conf

module(load="mmjsonparse") # for parsing CEE-enhanced syslog messages

Usage

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

var bstream = bsyslog.createBunyanStream({
      name: 'udptest',      // Optional. Defaults to process.title || process.argv[0]
      host: '127.0.0.1',    // Optional. Defaults to '127.0.0.1'
      port: 514,            // Optional. Defaults to 514
      facility: 'local0',   // Case-insensitive. Optional. Defaults to local0
      prefix: '@cee: '      // Add @cee cookie to message
    });

var log = bunyan.createLogger({
  streams: [{
    type: 'raw',    // Always use 'raw' bunyan stream
    level: 'trace', // Minimum log level
    stream: bstream
  }]
});

// Emit a log message
log.debug("This is a test");

// and close the socket
bstream.close();

bunyan-syslog-udp's People

Contributors

pchelolo avatar hknustwmf avatar gwicke avatar d00rman avatar

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.