chore: setup Winston/Morgan logging and standardize application logs (#35)#132
Open
gidadoabdullateef5 wants to merge 4 commits intoStellarFlow-Network:mainfrom
Open
Conversation
|
Hey @gidadoabdullateef5! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
Author
gidadoabdullateef5
left a comment
There was a problem hiding this comment.
I just resolved the complete. Kindly review, so the issue can be closed
Author
gidadoabdullateef5
left a comment
There was a problem hiding this comment.
Just resolved a merge conflict, kindly review, so the issue can be closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Setup Winston/Morgan Logging (#35)
📋 Summary
Standardized the backend logging infrastructure by migrating from raw
consolecalls to a centralized, structured logging system using Winston and Morgan.🚀 Proposed Changes
1. 🏗️ Infrastructure Setup
winstonfor professional, file-based structured logging.morganfor automated HTTP request logging.logs/directory.2. 🧹 Codebase Migration
Replaced over 50+ instances of
console.log,console.error, andconsole.warnwith:logger.info(): General application flow.logger.error(): Internal errors and transaction failures.logger.warn(): Performance alerts and fallback triggers.3. 🛡️ Affected Services
KES/GHS/NGNfetchers.sorobanEventListener.ts.apiKeyMiddleware.ts,socket.ts, webhook.ts.✅ Verification Implementation
Professional Log Format (JSON)
{"level":"info","message":"🌊 Backend running on port 3000","service":"stellarflow-backend","timestamp":"2026-03-29T07:57:40.534Z"} # PR: Setup Winston/Morgan Logging (#35) ## 📋 Summary Standardized the backend logging infrastructure by migrating from raw `console` calls to a centralized, structured logging system using **Winston** and **Morgan**. --- ## 🚀 Proposed Changes ### 1. 🏗️ Infrastructure Setup - Added `winston` for professional, file-based structured logging. - Integrated `morgan` for automated HTTP request logging. - Configured log rotation and persistence in the `logs/` directory. ### 2. 🧹 Codebase Migration Replaced over 50+ instances of `console.log`, `console.error`, and `console.warn` with: - `logger.info()`: General application flow. - `logger.error()`: Internal errors and transaction failures. - `logger.warn()`: Performance alerts and fallback triggers. ### 3. 🛡️ Affected Services - **Market Rates**: [marketRateService.ts](cci:7://file:///c:/BACKUP/former/Hackathon/stellar-flow-backend/stellarflow-backend/src/services/marketRate/marketRateService.ts:0:0-0:0), `KES/GHS/NGN` fetchers. - **Stellar Integration**: [stellarService.ts](cci:7://file:///c:/BACKUP/former/Hackathon/stellar-flow-backend/stellarflow-backend/src/services/stellarService.ts:0:0-0:0), `sorobanEventListener.ts`. - **Security & Infrastructure**: `apiKeyMiddleware.ts`, `socket.ts`, [webhook.ts](cci:7://file:///c:/BACKUP/former/Hackathon/stellar-flow-backend/stellarflow-backend/src/services/webhook.ts:0:0-0:0). --- ## ✅ Verification Implementation ### Professional Log Format (JSON) ```json {"level":"info","message":"🌊 Backend running on port 3000","service":"stellarflow-backend","timestamp":"2026-03-29T07:57:40.534Z"}