Winston transport implementation for using with mysql databases.
- winston (^3.5.1) [find it here]
- winston-transport [dependency for winston]
- sequelize (^5.3.3) [find it here]
- mysql2 (^1.6.5) [find it here]
const winston = require('winston');
const MySQLTransport = require('abso-winston-mysql-transport').WinstonMySQLTransport;
const logger = new winston.Logger({
transports: [
new MySQLTransport(
{... options_here ...}
)
]
});
{
level?: string (='info'),
tableName?: string (='winston_log'),
label?: string (=''),
connection: {
host: string,
port: integer,
database: string,
username: string,
password: string,
charset?: string (='utf8'),
collation?: string (='utf8_polish_ci')
}
}