Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Create a writable stream for syslog using C bindings.
JavaScript C++ Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
binding.gyp
index.js
package.json
syslog.cc

README.md

syslog-stream

Build Status

Create a writable stream for syslog using C bindings.

Installation

Install using npm:

npm install syslog-stream

Example

var syslog = require('syslog-stream')();

// Use stream methods
syslog.severity = 'debug';
fs.createReadStream(filename).pipe(syslog);
syslog.write('Message to syslog', 'utf8', function() {
  // written to syslog
});

// Use syslog methods
syslog.info('find me in the logs');
syslog.warn('Streams are too cool');
syslog.error('Red alert');

// Listen for log events
syslog.on('log', function(message, severity) {
  // Do something with message or severity
  // severity is 3 because you called .error below
});
syslog.error('something bad happened');

Test

Tests are written with mocha and should using BDD-style assertions.

Run them with npm:

npm test

MIT Licensed

Something went wrong with that request. Please try again.