winston-riak
A Riak transport for winston.
Installation
Installing npm (node package manager)
$ curl http://npmjs.org/install.sh | sh
Installing winston-riak
$ npm install winston$ npm install winston-riak
Motivation
tldr;?
: To break the winston codebase into small modules that work together.
The winston codebase has been growing significantly with contributions and other logging transports. This is awesome. However, taking a ton of additional dependencies just to do something simple like logging to the Console and a File is overkill.
Usage
var winston = ;//// Requiring `winston-riak` will expose// `winston.transports.Riak`//Riak;winston;
In addition to the options accepted by the riak-js client, the Riak transport also accepts the following options. It is worth noting that the riak-js debug option is set to false by default:
- level: Level of messages that this transport should log.
- bucket: The name of the Riak bucket you wish your logs to be in or a function to generate bucket names dynamically.
// Use a single bucket for all your logsvar singleBucketTransport = new winstontransportsRiak bucket: 'some-logs-go-here' ;// Generate a dynamic bucket based on the date and levelvar dynamicBucketTransport = new winstontransportsRiak{var d = now;return level + d d d;};
Metadata: Logged as JSON literal in Riak