comlog-system-monitor-log

1.3.1 • Public • Published

Watch a Logfile

Installation via

$ npm install -s comlog-system-monitor-log

Usage

var Service = require('comlog-system-monitor-log');

var csmf = new Service({
	path: '/path/to/file.log', // String or function
	// OR path: function() { return '/path/to/file.log'; },
	match: "/ERROR|WARN/i", // Optional (Default /ERROR/i)
	lines: 10, // Optional (Default 1)
	check: "function(conf, cb) { return true; //or cb(true); }" // Optional false == refresh watcher 
});

csmf.on('error', function(err) {
    console.error(err);
});

// bind event
csmf.on('down', function() {
    console.info('Log check Error');
});

// bind event
csmf.on('up', function() {
    console.info('Log check successfull');
});

csmf.start()

Readme

Keywords

none

Package Sidebar

Install

npm i comlog-system-monitor-log

Weekly Downloads

0

Version

1.3.1

License

COMLOG GmbH

Unpacked Size

5.74 kB

Total Files

3

Last publish

Collaborators

  • comlog.gmbh