A bookshelfjs transport for winston.
Installation
$ npm install bookshelf$ npm install knex$ npm install winston$ npm install winston-bookshelfjs-transport
Preparation
First you must generate your log table migration
var TABLE_NAME = "logs";exports {return knexschema;};exports {return knexschema};
Then make your log model
var bookshelf = ;var tableName = "logs";var {var self = this;selftableName = tableName;};var {var self = this;selftableName = tableName;selfrequiredColumns = ;};moduleexports = bookshelfModel;
Usage
make sure that you are passing in your bookshelf Log
model into the options.
var winston = ;// Requiring `winston-bookshelf-transport` will expose `winston.transports.Bookshelf`BookshelfTransport;options =model:;var logger = new winstonLogger;logger;logger;
Attribution
Lifted some code from sapher's mysql-wisnton-transport