MySQL transport plugin for winston@3.x logger, version 1.1.1. Enables logging directly to a MySQL database table with customizable fields and optional JSON meta support (requires MySQL 5.7+). Designed specifically for winston 3.x, it supports default and custom table schemas. Release cadence is low; no updates since 2020. Differentiator: simple integration with winston for MySQL logging, alternative to other transports like winston-database.
npm install winston-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a winston logger with MySQL transport using environment variables for credentials.
Create table with correct columns or use 'fields' option to map to existing columns.
Use MySQL 5.7+ for JSON column type or use string meta column.
Consider forking or patching to use mysql2 driver.
Implement connection pooling via external module or modify transport.
Run 'npm install winston-mysql'.
Ensure table has columns: level, message, meta, timestamp (or use fields option).
Upgrade MySQL to 5.7+ or change meta column to VARCHAR.
Start MySQL server and check host/port in options.