winston-postgre
A winston transporter for PostgreSQL database
Installation
npm install winston-postgre
Also, you need to have a table on your postgre database with the following structure:
(logdate time without time zone,level text,message text);
Options
- connectionString: The PostgreSQL connection string.
- schema: The schema which the table was created.
- table: The table name inside the database under the schema.
- level: The winston log level
See the default values used as example:
var options ="connectionString" : "postgres://username:password@localhost/database""schema" : "public""table" : "nodelogs""level" : "silly";
Usage
var winston = ;var db = ;var options ="connectionString" : "postgres://postgres:postgres@localhost/winstontest""schema" : "public""table" : "nodelogs""level" : "silly";winston;winston;winston;winston;winston;winston;
Feel free to open an issue or do a pull request.