{"id":46808,"library":"winston-redis","title":"winston-redis","description":"A capped Redis transport for the winston logging library (v3). Version 3.1.0 is the current stable release, with minimal maintenance updates since 2019. It stores log messages as JSON literals in a fixed-length Redis list, enabling efficient log rotation. Supports channel-based streaming and custom metadata. Requires Node >=8.11.x, winston ^3.0.0, and redis ^2.8.0. Alternatives include winston-logstash-transport or custom transports.","status":"maintenance","version":"3.1.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/winstonjs/winston-redis","tags":["javascript","logging","sysadmin","tools","winston","redis"],"install":[{"cmd":"npm install winston-redis","lang":"bash","label":"npm"},{"cmd":"yarn add winston-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add winston-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for logger instance","package":"winston","optional":false},{"reason":"Peer dependency for Redis client (version 2.x)","package":"redis","optional":false}],"imports":[{"note":"Default export is the Redis transport class, not a named export.","wrong":"import redisTransport from 'winston-redis'","symbol":"winston-redis","correct":"import Transport from 'winston-redis'"},{"note":"CJS users should require the whole module; it's a constructor.","wrong":"const { Redis } = require('winston-redis')","symbol":"winston-redis (CommonJS)","correct":"const redisTransport = require('winston-redis')"},{"note":"Instantiate with `new Transport()` directly; no static factories.","wrong":"new Transport.Redis()","symbol":"WinstonRedis Instance","correct":"new Transport({ container: 'logs' })"},{"note":"No built-in TypeScript declarations; create own or use `any`.","wrong":"import * as Transport from 'winston-redis'","symbol":"TypeScript types","correct":"import Transport from 'winston-redis'"}],"quickstart":{"code":"const winston = require('winston');\nconst Transport = require('winston-redis');\n\nconst logger = winston.createLogger({\n  level: 'info',\n  transports: [\n    new Transport({\n      host: process.env.REDIS_HOST || 'localhost',\n      port: process.env.REDIS_PORT || 6379,\n      length: 500,\n      container: 'app-logs'\n    })\n  ]\n});\n\nlogger.info('Hello from winston-redis');","lang":"javascript","description":"Shows how to create a winston logger with the winston-redis transport, including Redis host/port from environment variables."},"warnings":[{"fix":"Upgrade to winston 3.x and Node >=8.11.x.","message":"Requires Node >=8.11.x and winston 3.x only. Not compatible with winston 2.x.","severity":"breaking","affected_versions":"3.x"},{"fix":"Use `redis@2.8.0` explicitly or fork/update transport to support 3.x.","message":"The `redis` peer dependency is version 2.x. As of 2021, redis 3.x is LTS, but this transport may not work with it.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Manage the redis client lifecycle externally or avoid passing a client.","message":"If you pass an existing redis client via `options.redis`, the transport will not close it on `close()`. This can cause lingering connections.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use async/await or attach `.catch()` when calling `logger.log()` or `logger[level]()`.","message":"The transport now returns a promise from `log()` in winston 3.x; ensure error handling is updated.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'2.8.0':61 '2019':26 '3.0.0':58 '3.1.0':15 '8.11':55 'altern':62 'base':48 'cap':5 'channel':47 'channel-bas':46 'current':18 'custom':51,69 'effici':42 'enabl':41 'fix':37 'fixed-length':36 'includ':63 'javascript':71 'json':32 'length':38 'librari':12 'list':40 'liter':33 'log':11,29,43,72 'logstash':66 'mainten':23 'messag':30 'metadata':52 'minim':22 'node':54 'redi':3,6,39,60,76 'releas':20 'requir':53 'rotat':44 'sinc':25 'stabl':19 'store':28 'stream':49 'support':45 'sysadmin':73 'tool':74 'transport':7,67,70 'updat':24 'v3':13 'version':14 'winston':2,10,57,65,75 'winston-logstash-transport':64 'winston-redi':1 'x':56","created_at":"2026-06-07T13:01:43.852137+00:00","updated_at":"2026-06-07T13:01:43.852137+00:00","problems":[{"fix":"Install redis@2.8.0: `npm install redis@2.8.0`","cause":"Using redis 3.x which changed `createClient` to be a constructor.","error":"TypeError: redis.createClient is not a function"},{"fix":"Start Redis server or set `host`/`port` options correctly.","cause":"Redis server not running or unreachable at default host:port.","error":"Error: connect ECONNREFUSED 127.0.0.1:6379"},{"fix":"Upgrade winston to 3.x: `npm install winston@3`","cause":"Using winston 2.x which does not have `createLogger`.","error":"TypeError: winston.createLogger is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/winstonjs/winston-redis#readme","github":"ssh://git@github.com/winstonjs/winston-redis","docs":null,"changelog":null,"pypi":null,"npm":"winston-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}