syslog-server
NodeJS Syslog Server
Last updated 3 years ago by guithess .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install syslog-server 
SYNC missed versions from official npm registry.

SyslogServer

NodeJS Syslog Server.

Quickstart

Installation
$ npm install syslog-server
Usage
const SyslogServer = require("syslog-server");
const server = new SyslogServer();

server.on("message", (value) => {
    console.log(value.date);     // the date/time the message was received
    console.log(value.host);     // the IP address of the host that sent the message
    console.log(value.protocol); // the version of the IP protocol ("IPv4" or "IPv6")
    console.log(value.message);  // the syslog message
});

server.start();

Functions

.start([options], [callback])
  • options <Object> - Optional - The options passed to the server. Supports the following properties:

    • port [Number] - Optional - Defaults to 514.
    • address [String] - Optional - Defaults to "0.0.0.0".
    • exclusive [Boolean] - Optional - Defaults to true.

    For more informatio on the options object, check NodeJS oficial API documentation.

  • callback [Function] - Optional - Callback function called once the server starts, receives an error object as argument should it fail.

The start function returns a Promise.

.stop([callback])
  • callback [Function] - Optional - Callback function called once the server socket is closed, receives an error object as argument should it fail.

The stop function returns a Promise.

.isRunning()

The isRunning function is a synchronous function that returns a boolean value, if the server is ready to receive syslog messages or not.

Events

  • start - fired once the server is ready to receive syslog messages
  • stop - fired once the server is shutdown
  • error - fired whenever an error occur, an error object is passed to the handler function
  • message - fired once the server receives a syslog message

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |