{"id":25476577,"url":"https://github.com/anusthan12/winston-logging","last_synced_at":"2026-05-01T04:36:48.955Z","repository":{"id":273735369,"uuid":"920713069","full_name":"anusthan12/Winston-logging","owner":"anusthan12","description":"Implementation of Winston with daily file rotation for logging ","archived":false,"fork":false,"pushed_at":"2025-01-22T16:45:54.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T17:35:18.144Z","etag":null,"topics":["anusthan","anusthan12","anusthansingh","logging","mvc-architecture","nodejs","winston","winston-daily-rotate-file","winston-logger"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anusthan12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T16:39:40.000Z","updated_at":"2025-01-22T16:47:45.000Z","dependencies_parsed_at":"2025-01-22T17:46:05.572Z","dependency_job_id":null,"html_url":"https://github.com/anusthan12/Winston-logging","commit_stats":null,"previous_names":["anusthan12/winston-logging"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusthan12%2FWinston-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusthan12%2FWinston-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusthan12%2FWinston-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusthan12%2FWinston-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anusthan12","download_url":"https://codeload.github.com/anusthan12/Winston-logging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475930,"owners_count":19645041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anusthan","anusthan12","anusthansingh","logging","mvc-architecture","nodejs","winston","winston-daily-rotate-file","winston-logger"],"created_at":"2025-02-18T12:57:58.463Z","updated_at":"2026-05-01T04:36:48.936Z","avatar_url":"https://github.com/anusthan12.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Node.js Logger\n\nImplementation of Winston with daily file rotation for logging in Node.js applications, featuring multi-level logging, daily rotation, and comprehensive request tracking.\n\n[![Node.js](https://img.shields.io/badge/Node.js-Backend-339933?style=flat-square\u0026logo=node.js\u0026logoColor=white)](#)\n[![Winston](https://img.shields.io/badge/Winston-Logger-231F20?style=flat-square\u0026logo=winston\u0026logoColor=white)](#)\n[![MVC](https://img.shields.io/badge/Architecture-MVC-007ACC?style=flat-square)](#)\n\n## Features\n\n- **Three-tier logging system:**\n  - Access logs (L1) — Basic request/response information\n  - Detail logs (L2) — Comprehensive debug information\n  - Error logs (L3) — Error tracking with stack traces\n- **Daily log rotation** with 200MB file size limit, 14-day retention, and automatic compression\n- **Request Tracking** — Method, URL, response time, status code, and IP address logging\n- **Error Handling** — Stack trace capture, request context preservation, and detailed error metadata\n- **Security** — Automatic directory creation, safe file rotation, and error protection\n\n## Installation\n\n```bash\nnpm install winston winston-daily-rotate-file node-cron\n```\n\n## Usage\n\n```javascript\nconst logger = require('./path/to/logger');\nconst express = require('express');\nconst app = express();\n\napp.use(logger.requestLogger);  // Apply logger middleware\napp.use(logger.errorHandler);   // Error handling\n```\n\n## Log Levels\n\n| Level | Code | Description |\n| :--- | :---: | :--- |\n| Emergency | 0 | System is unusable |\n| Alert | 1 | Immediate action required |\n| Critical | 2 | Critical conditions |\n| Error | 3 | Error conditions |\n| Warning | 4 | Warning conditions |\n| Notice | 5 | Normal but significant condition |\n| Info | 6 | Informational messages |\n| Debug | 7 | Debug-level messages |\n\n## File Structure\n\n```\nlogs/\n├── access/\n│   └── DD-MM-YYYY-access.log\n├── detail/\n│   └── DD-MM-YYYY-detail.log\n└── error/\n    └── DD-MM-YYYY-error.log\n```\n\n## Configuration\n\nCustomize logging behavior by modifying the file rotation schedule (cron expression), file size limits, retention period, timestamp format, and log formats.\n\n## Author\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eBuilt and maintained by \u003ca href=\"https://github.com/anusthan12\"\u003eAnusthan Singh\u003c/a\u003e · © 2025\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusthan12%2Fwinston-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanusthan12%2Fwinston-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusthan12%2Fwinston-logging/lists"}