Improvement: Winston + Morgan logging setup (#1285)#1290
Improvement: Winston + Morgan logging setup (#1285)#1290Avdhesh-Varshney merged 12 commits intocode-a2z:mainfrom 100NikhilBro:feature/winston-morgan-logging
Conversation
|
@100NikhilBro is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE. |
|
I just created a PR and wanted to share it with you. Please have a look when you get a chance, and let me know if any updates or improvements are needed. Thanks! |
|
@Avdhesh-Varshney Hi bro 👋 Also, please review the PR whenever you get time. If you feel it’s valid, you can label it as level 2 (not necessary, only if feasible). Thanks! 🙌 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
Nikhil, Could you check why the preview not working? |
|
Hi @Avdhesh-Varshney, |
|
Hi @Avdhesh-Varshney 👋, bro just checking — is there any issue from my side or with my PR that I might have missed? If yes, please let me know and I’ll update it. Otherwise, you can review and merge it. 😊 |
Bro, this link requires authorization — I’m not able to access it directly. Could you please confirm if it’s meant to be private or if I need some credentials/token to view it? |
|
@Avdhesh-Varshney okk bro i will check the other issues |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a production-ready logging solution using Winston for application-level logging and Morgan for HTTP request logging. The setup provides structured logging with automatic log file management and request-level logger attachment.
- Added Winston logger configuration with file and console transports
- Integrated Morgan middleware for HTTP request logging
- Updated error handler to use the new logging system
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/server.js | Imports and applies the logging middleware to the Express app |
| server/src/middlewares/logging.middleware.js | Creates middleware that sets up Morgan and attaches logger to requests |
| server/src/middlewares/error.handler.js | Updates error handling to use Winston logger instead of console.error |
| server/src/logger/winston.js | Configures Winston logger with file transports and formatting |
| server/src/logger/morgan.js | Sets up Morgan HTTP logging middleware with Winston integration |
| server/package.json | Adds winston and morgan dependencies |
Files not reviewed (1)
- server/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Is our backend ready or already deployed? If yes, please merge this PR. Just a reminder — tomorrow is the last date for this program, so it would be great to get this resolved as soon as possible. Thanks! |

📝 Logging Setup - Winston + Morgan
Issue / Feature
Improvement: Winston + Morgan Logging Setup (#1285)
This setup provides a production-ready logging solution for Express apps, using Winston for application-level logging and Morgan for HTTP request logging.
🗂 Folder Structure
Notes:
logs/folder is auto-created on first runerror.log→ contains only error-level logscombined.log→ contains all logs⚡ Features
🛠 Installation / Usage
npm install winston morganapp.get('/', (req, res) => {
req.logger.info('Home route accessed!')
res.send('Logging system working perfectly 🚀')
})
⚙️ Logging Behavior
logs/error.loglogs/combined.log