Skip to content

[LTI Provider] Improve logging in send_composite_outcome Celery task #38442

@ayub02

Description

@ayub02

Problem

The send_composite_outcome Celery task currently produces minimal log output. On success, only the generic Celery trace log is emitted — no context about what grade was sent, to whom, or for which user/course/assignment.

Current log output (on success):

Task lms.djangoapps.lti_provider.tasks.send_composite_outcome[<task-id>] succeeded in 2.3s: None

This makes it difficult to:

  • Confirm which grade value was actually sent to the LTI consumer
  • Identify which user or course/assignment was involved
  • Diagnose failures without external timestamps (e.g., checking Canvas directly)

Suggested Improvements

Add structured log statements inside send_composite_outcome (and related tasks) that include:

  1. User identifier — whose grade is being sent (user ID or anonymized ID)
  2. Course and usage key — which course/assignment triggered the passback
  3. Grade value — the score being submitted (e.g., 0.85)
  4. LTI outcome URL — the endpoint on the consumer side receiving the grade
  5. Result on failure — HTTP status code, response body, or exception detail

Expected Benefit

Operators and support teams can confirm grade passback without needing Canvas-side investigation. Failures become immediately diagnosable from logs alone.

Files Likely Involved

  • lms/djangoapps/lti_provider/tasks.py
  • lms/djangoapps/lti_provider/outcomes.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions