-
Notifications
You must be signed in to change notification settings - Fork 46
refactor: update logger service integration across the application #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Renamed logger variable to loggerService for consistency. - Updated logging calls to use the new loggerService structure. - Replaced winston with @omdxp/jslog for improved logging capabilities. - Added graceful shutdown handling for logger file streams. - Enhanced log messages with additional context and structured attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the application's logging infrastructure by replacing the winston logging library with @omdxp/jslog. The changes rename logger references to loggerService for consistency and update all logging call patterns to use the new library's API. The new implementation includes environment-specific configurations (pretty console output for development, JSON file logging for production) and adds graceful shutdown handling for logger file streams.
- Replaced winston with @omdxp/jslog (version 1.7.1)
- Standardized logger variable naming to
loggerServiceacross all services - Enhanced logging with structured attributes using key-value pairs instead of object-based messages
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Added @omdxp/jslog dependency and removed winston |
| package-lock.json | Updated dependency lockfile with @omdxp/jslog and removed winston-related packages |
| api/src/logger/service.ts | Completely rewrote logger service to use @omdxp/jslog with environment-specific handlers and file stream management |
| api/src/app/index.ts | Added graceful shutdown handlers for SIGTERM/SIGINT signals to close logger file streams |
| api/src/app/middlewares/logger.ts | Updated HTTP logging middleware to use new logger API with structured request/response attributes |
| api/src/search/service.ts | Updated logger variable name and logging calls to use new structured format |
| api/src/postgres/service.ts | Updated logging calls to use new loggerService.logger.info() pattern |
| api/src/fetch/service.ts | Updated logger variable name and logging calls with structured attributes |
| api/src/digest/cron.ts | Updated logger variable name and logging calls throughout the cron job |
| api/src/ai/service.ts | Updated logger variable name and logging call |
| .gitignore | Added api/logs directory to ignore list for log files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Uh oh!
There was an error while loading. Please reload this page.