Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77406

Log every time a user adds a file to a draft area

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • Hide

      This basically creates a web log when we add an item to the File picker draft area

      Steps:

      1. Open a Forum activity in a course
      2. Start a new Discussion or could reply to one of them
      3. Add a file to the attachment section (but don't save the forum post).
      4. Now navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs
      5. Verify that the ‘File added to draft area’ event is displayed, with details containing userid, filename and filesize.

      Have also added a Behat test

      Show
      This basically creates a web log when we add an item to the File picker draft area Steps: Open a Forum activity in a course Start a new Discussion or could reply to one of them Add a file to the attachment section (but don't save the forum post). Now navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs Verify that the ‘File added to draft area’ event is displayed, with details containing userid, filename and filesize. Have also added a Behat test

    Description

      At the moment, when users are uploading files into Moodle, that is not logged separately. Intead, whatever thing the file is part of (for example, an attachment to a forum post, or an assignment submission) gets logged when that thing is submitted (E.g. forum_post_added - but only if they remember to save the forum post, and then there is no specific information about the file).

      However, some of the files that users upload are very, very important. For example the answers to an exam. And, based on our experience of administering exams over the last few years, sometimes students ring up and say "I uploaded this file to Moodle, but there is no sign of it now". At this point, it would be very, very helpful to have as much information recorded as possible about file uploads. In the web server logs, you can see the POST to repository/repository_ajax.php?action=upload..., but that is very limited information.

      Therefore, we would like to add logging in repository_upload::process_upload, to log whenever a file has been successfully uploaded to a draft file area. At least for us, this would be very helpful. The log will include the file's filename and its size. (At the moment, the only way that a file upload gets logged is if the file fails virus scanning. That is logged.)
       
      Total volumn of Moodle logs is a problem, but given the total number of files that get uploaded to Moodle, We don't think adding this logging will be excessive.

      Questions we are not sure about:

      1. Should we log at the end of process_upload, or at the start? (Or even, both)
      2. Should we also log in webservice/upload.php?

      Attachments

        Issue Links

          Activity

            People

              Anupama Sarjoshi Anupama Sarjoshi
              Anupama Sarjoshi Anupama Sarjoshi
              Tim Hunt Tim Hunt
              Ilya Tregubov Ilya Tregubov
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              9 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 27 minutes
                  1h 27m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.