-
Notifications
You must be signed in to change notification settings - Fork 0
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
Structured logging #17
Conversation
- switched to winston for logging - added morgan for access logging - made /health never 304 - uncaughtException handler - unhandledRejection handler - respawning crashed worker fix
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.
👍 Looks good to me! Reviewed everything up to 1ac9796 in 42 seconds
More details
- Looked at
327
lines of code in6
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. test/unit/ThumbnailApi.test.ts:54
- Draft comment:
Consider adding assertions to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendError
method inThumbnailApi
is tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
2. test/unit/ThumbnailApi.test.ts:326
- Draft comment:
Consider adding assertions to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. This comment applies to other test cases where errors are logged, such asproxyItemFromContributor: bad body
andupstream failed
. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a new logger using Winston, but the test cases do not verify the logger's output. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
3. src/ThumbnailApi.ts:179
- Draft comment:
Consider adding tests to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendError
method inThumbnailApi
is tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
4. src/app.ts:85
- Draft comment:
Consider adding tests to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendError
method inThumbnailApi
is tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
Workflow ID: wflow_7iz5bjw9b1mwMA2a
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 9512583 in 12 seconds
More details
- Looked at
688
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/ExpressSetup.ts:38
- Draft comment:
Usingprocess.exit
can lead to abrupt shutdowns, which might not allow pending operations to complete. Consider using a more graceful shutdown approach, ensuring all pending operations are completed before exiting. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using winston and morgan, replacing console statements. The changes seem well-implemented, but there's a minor issue with the use ofprocess.exit
in thehandleExit
method. Usingprocess.exit
can lead to abrupt shutdowns, which might not allow pending operations to complete. It's better to gracefully shut down the server and then exit the process.
Workflow ID: wflow_IicYUxd71YJMvUn2
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Quality Gate passedIssues Measures |
Important
Introduce structured logging with
winston
andmorgan
, replacingconsole
statements and updating tests accordingly.winston
for structured logging inlogger.ts
.console
withlogger
inResponseHelper.ts
,ThumbnailApi.ts
, andapp.ts
.morgan
middleware for HTTP request logging inapp.ts
.winston
andmorgan
todependencies
inpackage.json
.@types/morgan
todevDependencies
inpackage.json
.sendError
inThumbnailApi.ts
to uselogger
.app.ts
foruncaughtException
andunhandledRejection
to log errors and exit.ThumbnailApi.test.ts
to silence logger during tests and verify error handling.This description was created by for 9512583. It will automatically update as commits are pushed.