node-log2
A simple log utility to be used in Node.js applications.
Install
$ npm install node-log2
Introduction
node-log2 can write to a MySQL database. Other writers can be added.
import * as log2 from "node-log2";import * as mysql from "mysql"; // here we create the connection to MySQLconst mysqlConnection = mysql.createConnection; // we initiate the writer with previously created MySQL connection and the table nameconst writer = new log2.MySQLWriter; // we initiate the loggerconst log = new log2.Log; // you can pass any data as first parameterlog.info;log.warning;log.error;log.security;