winston-beanstalkd
A Beanstalkd transport for winston.
Motivation
To enable a log-based work queue compatible with existing logging mechanisms.
Usage
var winston = ;//// Requiring `winston-beanstalkd` will expose// `winston.transports.Beanstalkd`//Beanstalkd;winston;
The Beanstalkd transport takes the following options. 'host' is required:
- silent: Boolean flag indicating whether to suppress output, defaults to false.
- host: The host running Beanstalkd, defaults to localhost.
- port: The port on the host that Beanstalkd is running on, defaults to
- tube: The name of the tube you want to log to, defaults to 'winston.log'. See beanstalkd FAQ.
- delay: See the beanstalkd FAQ.
- priority: See the beanstalkd FAQ.
- ttr: See the beanstalkd FAQ.
- levelFilter: Whether to append the logging level to the tube name to filter on log level.
- transformMessage: A custom function for transforming logged objects to a queue string, defaults to JSON.stringify().
Installation
Installing npm (node package manager)
$ curl http://npmjs.org/install.sh | sh
Installing winston-beanstalkd
$ npm install winston$ npm install winston-beanstalkd
Usage
See the examples for a logger and a watcher.
In one console, start the watcher:
$ node examples/watch.jsWatching
In another console, run the logger:
$ node examples/logger.jsinfo: Beanstalkd log event!warn: This is a warning!error: This is an error! code=505, anything=This is metadatahelp: Log number 0help: Log number 1help: Log number 2help: Log number 3help: Log number 4log put to winston.log
Return to the watcher console and see the output from processing the log entries:
$ node examples/watch.jsWatching