A logging server built on top of winston, capable of receiving, querying, and streaming logs.
Each winstond server can utilize up to 3 different services, which leverage the main capabilities of a winston transport.
collect
- log collectionquery
- querying logsstream
- streaming logs
var winstond = require('winstond');
var server = winstond.nssocket.createServer({
services: ['collect', 'query', 'stream'],
port: 9003
});
server.add(winstond.transports.File, {
filename: __dirname + '/foo.log'
});
server.listen();
var winston = require('winston');
winston.add(require('winston-nssocket').Nssocket, {
host: 'localhost',
port: 9003
});
winston.log('info', 'Hello world!', {
foo: 'bar'
});
winston.stream().on('log', function(log) {
console.log(log);
});
winston.query({ start: 10 }, function(err, results) {
if (err) throw err;
console.log(results);
});
winstond supports http and nssocket backends.
$ npm install winstond -g