bunyan-rethinkdb
Bunyan logger that sends data to RethinkDB.
Installation
bunyan-rethinkdb
expects that you have already installed rethinkdb
.
npm instal --save-dev bunyan-rethinkdb
Usage
bunyan-rethinkdb
expects the follow:
- You have already created
bunyan_logs
(or another table configured viatableName
option) - You have already opened your connection. If the connection is closed,
bunyan-rethinkdb
will try to send the data when connection is (re)opened.
;;; // open RethinkDB connection first// const connection = ... const logger = bunyan; logger;
Options
Constructor takes an optional third value with options: new BunyanToRethinkDB(r, connection, options)
bufferLength
Whenever buffer reaches number of log messages specified by bufferLength
, all messages will be sent to RethinkDB. Default value is 1
.
bufferTimeout
Buffer will be sent to RethinkDB every bufferTimeout
milliseconds. Zero disables this feature. Default value is 0
.
tableName
RethinkDB table name. Default value is bunyan_logs
.
License
ISC