-
Notifications
You must be signed in to change notification settings - Fork 14
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
#2790 - Update API Access Logs #4334
Conversation
sources/packages/backend/apps/api/src/middlewares/access-logger.middleware.ts
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/middlewares/access-logger.middleware.ts
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/middlewares/access-logger.middleware.ts
Show resolved
Hide resolved
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.
Nice changes, please take a look at the comments.
/** | ||
* Logs access information of every request. | ||
* @param request http request. | ||
* @param _response http request. |
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.
Please change to http reponse.
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.
Thanks for making the changes, the middleware is a great addition and can help guide other development in the future. Look good 👍
|
Please add any sample error logs, if user not logged in and without correct permission. |
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.
LGTM @dheepak-aot
Update API Access Logs
Implementation of Access logging with NestJS Middleware
NestJS Middleware
Resource: https://docs.nestjs.com/middleware
Http Method
,URL
,Client IP
,User GUID(on authenticated endpoints)
andUser Agent Header
for all requests to API.Authenticated API access logs
Non-Authenticated API access logs
Refactor health controller
Centralization