winston-daily-rotate-file

A Winston transport that rotates log files daily, by size, and with automatic compression

Library
npm
v5.0.0
928stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
46/100Fair
Development Activity0
Maintenance20
Community76
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture76
Code Quality80
Innovation55
Learning Curve85

winston-daily-rotate-file is a transport plugin for the Winston logging library that writes logs to a file that automatically rotates on a daily basis (or a configurable pattern), with optional size-based rotation, gzip compression of rotated files, and automatic pruning of old logs by age or total count. It’s a common addition to any Node.js service using Winston that needs disk-based logs without unbounded file growth or manual log-rotation tooling.

The package integrates directly into Winston’s transport interface, so it’s added alongside console or other transports in a standard Winston logger configuration rather than requiring a separate logging pipeline.

What You Get

  • A drop-in Winston transport following the standard winston.transports interface
  • Daily rotation by default, with configurable date patterns and size-based rotation thresholds
  • Optional gzip compression of rotated log files
  • Automatic pruning of old logs by max file count or max age
  • Events (rotate, new, archive, logRemoved) for hooking into the rotation lifecycle

Common Use Cases

  • Node.js services writing persistent file-based logs that need automatic daily rotation instead of one ever-growing log file
  • Compliance/audit logging setups that need retained, dated, and eventually pruned log archives
  • Reducing disk usage on long-running servers by combining size-based rotation with gzip compression
  • Hooking into rotation events to trigger log shipping/upload to external storage right after a file rotates

Under The Hood

Architecture: The core (daily-rotate-file.js, ~370 lines) extends Winston’s TransportStream base class and computes the current file name from a moment-style date pattern on each write, opening a new file stream when the pattern’s rendered value changes (i.e. when the day rolls over) or when a size threshold is exceeded. Rotation, archiving (gzip), and pruning are handled as side effects triggered from within the same write path rather than a separate background scheduler process.

Tech Stack: Plain Node.js/CommonJS, depending directly on winston-transport for the base class contract and using Node’s built-in zlib/fs for compression and file I/O rather than external rotation binaries.

Code Quality: The test/transport-tests.js suite covers rotation-by-date, rotation-by-size, and pruning behavior, plus a transport.worker.js used to validate behavior when logging from multiple processes. TypeScript definitions (index.d.ts) are bundled for consumer type safety, though the project has had no commits since March 2024.

API Design: Configuration is a flat options object passed straight into Winston’s standard transport-array pattern (new transports.DailyRotateFile({...})), so anyone already familiar with Winston can add rotation with a single new transport entry — a low learning curve given prior Winston familiarity.

Used by 10 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
TypeScript
80%
MIT

LibreChat

Developer Tools · AI Assistants

42,216

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
68
Dependency
Built with
TypeScript80%
JavaScript19%
Updated today
TypeScript
88%
Apache 2.0

Medplum

Developer Tools · Databases · Authentication

2,614

An open-source, FHIR-native healthcare platform that gives developers a compliant backend, authentication, a React component library, and serverless bots to build clinical applications in weeks instead of years.

View details
93
Repo Health
90
Technical
72
Dependency
Built with
TypeScript88%
MDX10%
Updated today
TypeScript
99%
Other

NocoBase

No Code Platforms · Low Code Platforms

23,696

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
99%
AGPL 3.0

Pangolin

Networking

22,378

An open-source, identity-based zero-trust remote access platform built on WireGuard — a self-hostable alternative to Cloudflare Tunnel and Twingate with SSO, OIDC, and tunneled reverse proxying.

View details
87
Repo Health
68
Technical
72
Dependency
Built with
TypeScript99%
Updated today
JavaScript
98%
Apache 2.0

Parse Server

Developer Tools · Databases

21,409

Self-hosted Backend-as-a-Service for Node.js with REST, GraphQL, real-time Live Query, cloud code, and pluggable adapters for any infrastructure.

View details
96
Repo Health
81
Technical
78
Dependency
Built with
JavaScript98%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search