-
Notifications
You must be signed in to change notification settings - Fork 4.2k
chore(logging): add additional logs for LTI launch flow #37593
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
Conversation
|
Thanks for the pull request, @arslanashraf7! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
1b0e60f to
7286852
Compare
|
This looks good to me, but I'm wondering if @xitij2000 could take a quick look since he's been involved with the LTI provider code. |
xitij2000
left a comment
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.
Ill have a better look tomorrow, but i think only the relevant bits of the request object should be logged.
lms/djangoapps/lti_provider/users.py
Outdated
| log.info( | ||
| 'LTI consumer requires existing user account for LTI user ID: %s from request: %s', | ||
| lti_user_id, | ||
| 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.
I think logging the request object is a bit overkill. I think it should be restricted to the relevant information.
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.
The request part is basically for the URL that includes the course_id, block_id which will prove to be very useful while debugging issues with LTI. An example of this log currently looks like below:
2025-11-03 12:56:54,511 INFO 568 [edx.lti_provider] [user None] [ip 172.20.0.1] users.py:60 - LTI consumer requires existing user account for LTI user ID: <redacted_user_id> from request: <WSGIRequest: POST '/lti_provider/courses/course-v1:ORG+COURSE+1/block-v1:ORG+COURSE+1+type@vertical+block@ebe43296cab94c078b6fb3bb89f9863f'>
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.
I think in that case you can log the course_id and block_id instead of the request. If you need the URL, you can log the URL.
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.
@xitij2000 Sounds good, since the URL contains both the course_id and block_id, so I don't think we need to log them separately. I have updated the PR to just log request.path instead of the full request object. Let me know if this looks good to you.
850d083 to
15ebbca
Compare
|
@xitij2000 could you take another look at it? This is ready for your review, Thanks. |
| 'LTI consumer requires existing user account for LTI user ID: %s from request: %s', | ||
| lti_user_id, | ||
| request.path | ||
| ) |
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.
I think the log output should be updated to mention that it's outputting the request path and not the request object.
xitij2000
left a comment
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.
Just have one minor nit, which is to update the log message to mention that it's outputting the path and not the request.
@xitij2000 thanks for the review. I've updated the messages to mention path in 1d72fec. |
|
@arslanashraf7 @xitij2000 is this ready to merge? |
1d72fec to
3bbd6ba
Compare
3bbd6ba to
1b2bfaf
Compare
Yes. @pdpinch I've squashed the commits and rebased the PR. |
|
@arslanashraf7 can we backport this to ulmo? |
pdpinch
left a comment
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
chore(logging): add additional logs for LTI launch flow
Sure, The backport is #37707 |
chore(logging): add additional logs for LTI launch flow
Description
There is not enough logging around the LTI feature when edX works as an LTI provider. This makes debugging any errors hard, and you have to run through the code to actually identify the failing reason.
This PR aims at improving this debugging and log information experience by adding additional logs around this feature.
Useful information to include:
Supporting information
Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
FEATURES["ENABLE_LTI_PROVIDER"] = Truein your settings/envPlease provide detailed step-by-step instructions for testing this change.
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Internal ticket: https://github.com/mitodl/hq/issues/6850
Include anything else that will help reviewers and consumers understand the change.