Note: You are currently viewing documentation for Moodle 3.11. Up-to-date documentation for the latest stable version of Moodle may be available here: Logging.

Logging: Difference between revisions

From MoodleDocs
(Add link to log storage plugins)
(Improve quality of docs and add more information)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
When users interact with Moodle, many of their interactions are logged using the Events subsystem. This subsystem includes a powerful, and granular, logging mechanism which allows the collection of relevant information.


The site administrator can define which log stores are available, and in which order, from ''Administration>Site administration>Plugins>Logging>Manage log stores.''
The Moodle core logs common interactions, and most activities also include granular logging of student progress through the activity.


Available stores are: Standard, Legacy and External database.
Examples of log entries include:
 
* logging in or out
* accessing a course
* updating a course
* viewing an activity within a course
* viewing a forum discussion
* creating a new forum discussion
* replying to an existing post in a forum discussion
* completing an activity
 
== Log stores ==
 
When an event is logged, it can be sent to zero, or more log stores. A log store is simply a data warehouse for the log entries.
 
Moodle comes includes with three log stores:
 
* Standard
* External database
* Legacy - typically only used if you have used an older version of Moodle. You should not normally need to enable this log store.
 
Your site administrator can choose which log stores are enabled, and in which order, from ''Administration > Site administration > Plugins > Logging > Manage log stores.''


''Note:'' A new Moodle site will have Standard logging enabled and Legacy logging disabled. A site which has been upgraded will have both enabled.
''Note:'' A new Moodle site will have Standard logging enabled and Legacy logging disabled. A site which has been upgraded will have both enabled.


The default Standard log is very detailed and should meet most requirements. The Legacy log should be disabled unless you have old custom reports that need it. An External database log store also allows you to connect to an external log database.
The default Standard log is very detailed and should meet most requirements.


Note that if you disable Legacy logs, you won't be able to look/show/display (existing) Legacy logs, and no new Legacy logs will be generated. This could be a problem for non -standard plugins which still  generate Legacy logs instead of Standard logs. In time it is to be hoped all contributed plugins will use Standard logs. You can disable the legacy store plugin completely OR you can only disable writing to legacy log inside the plugin settings. In the second case, you will be able to read from the log but no new entries will be added. This is also what will be set automatically during upgrade.
The "Write buffer size" is the number of log entries inserted in one batch database operation, which improves performance.


[[File:logstores.png]]
[[File:logstores.png]]


From ''Site administration>Plugins>Reports>Manage reports'', the administrator can see which log stores support which given report:
From ''Site administration > Plugins > Reports > Manage reports'', the administrator can see which log stores support which given report:


[[File:reportslogstore.png]]
[[File:reportslogstore.png]]


== External log stores (logstore_database) ==
=== External log store ===
 
An External database log store also allows you to connect to an external log database. This uses the same logging format as the Standard log store, but allows you to send logs to a different database. It can still be queried from within the Moodle User Interface, and is sometimes preferable on busy sites where many logs are created.
 
=== Legacy log store ===
 
The Legacy log should be disabled unless you have old custom reports that need it.
 
Note that if you disable Legacy logs, you won't be able to look/show/display (existing) Legacy logs, and no new Legacy logs will be generated. This could be a problem for non -standard plugins which still  generate Legacy logs instead of Standard logs. In time it is to be hoped all contributed plugins will use Standard logs. You can disable the legacy store plugin completely OR you can oNoy disable writing to legacy log inside the plugin settings. In the second case, you will be able to read from the log but no new entries will be added. This is also what will be set automatically during upgrade.
 
'''''This plugin will be removed in Moodle 4.1.'''''
 
== Analytics ==


An External database log store also allows you to connect to an external log database.
Moodle also has a powerful [[Analytics]] engine, which uses Machine Learning to predict and warn of potential student outcomes. Many of these predictions are based upon the logs that are generated and stored by Moodle.


This log storage plugin is responsible for storing and retrieving the logs ([https://docs.moodle.org/dev/Logging_2#Figure1 steps 2 and 3 from Figure 1]).  There is no interface to read or display from it provided with Moodle core.
Please note that some Log Store plugins are write-only and ''cannot'' be used for this purpose. Both the Standard logstore, and the External logstore included with Moodle ''are'' compatible with the Moodle Analytics features.


==See also==
==See also==


* [[Logs]]  
* [[Logs]]
* [[Events list report]]
* [[Events list report]]
* [[:dev:Event_2 | Developer documentation on Events (giving examples of levels)]]
* [[:dev:Event_2 | Developer documentation on Events (giving examples of levels)]]

Latest revision as of 04:08, 5 July 2022

When users interact with Moodle, many of their interactions are logged using the Events subsystem. This subsystem includes a powerful, and granular, logging mechanism which allows the collection of relevant information.

The Moodle core logs common interactions, and most activities also include granular logging of student progress through the activity.

Examples of log entries include:

  • logging in or out
  • accessing a course
  • updating a course
  • viewing an activity within a course
  • viewing a forum discussion
  • creating a new forum discussion
  • replying to an existing post in a forum discussion
  • completing an activity

Log stores

When an event is logged, it can be sent to zero, or more log stores. A log store is simply a data warehouse for the log entries.

Moodle comes includes with three log stores:

  • Standard
  • External database
  • Legacy - typically only used if you have used an older version of Moodle. You should not normally need to enable this log store.

Your site administrator can choose which log stores are enabled, and in which order, from Administration > Site administration > Plugins > Logging > Manage log stores.

Note: A new Moodle site will have Standard logging enabled and Legacy logging disabled. A site which has been upgraded will have both enabled.

The default Standard log is very detailed and should meet most requirements.

The "Write buffer size" is the number of log entries inserted in one batch database operation, which improves performance.

logstores.png

From Site administration > Plugins > Reports > Manage reports, the administrator can see which log stores support which given report:

reportslogstore.png

External log store

An External database log store also allows you to connect to an external log database. This uses the same logging format as the Standard log store, but allows you to send logs to a different database. It can still be queried from within the Moodle User Interface, and is sometimes preferable on busy sites where many logs are created.

Legacy log store

The Legacy log should be disabled unless you have old custom reports that need it.

Note that if you disable Legacy logs, you won't be able to look/show/display (existing) Legacy logs, and no new Legacy logs will be generated. This could be a problem for non -standard plugins which still generate Legacy logs instead of Standard logs. In time it is to be hoped all contributed plugins will use Standard logs. You can disable the legacy store plugin completely OR you can oNoy disable writing to legacy log inside the plugin settings. In the second case, you will be able to read from the log but no new entries will be added. This is also what will be set automatically during upgrade.

This plugin will be removed in Moodle 4.1.

Analytics

Moodle also has a powerful Analytics engine, which uses Machine Learning to predict and warn of potential student outcomes. Many of these predictions are based upon the logs that are generated and stored by Moodle.

Please note that some Log Store plugins are write-only and cannot be used for this purpose. Both the Standard logstore, and the External logstore included with Moodle are compatible with the Moodle Analytics features.

See also