Conversation
There was a problem hiding this comment.
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.
- 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Uh oh!
There was an error while loading. Please reload this page.