Logging in Totara allows you to collect details of interactions on the system, such as when a user logs in or accesses a course. There are three core types of log stores (where the data collected during logging will be saved) which are: Standard log, Legacy log, and External database log.
The logstore_legacy plugin for the Legacy log has been deprecated in Totara 13.
Core log stores
By default the Standard log will be enabled, and this should work well in most cases. The Legacy logs should be left as disabled unless you have custom logs from an older version of Totara which you still wish to use. Finally, the External database log can be enabled if you wish to connect your Totara site up to an outside log store. To enable or disable any of these (as a Site Administrator) you will need to go to Plugins > Logging > Manage log stores in the quick-access menu. You will also be able to access the settings for any enabled log stores.
Standard log and Legacy log both allow you to configure whether you wish to Log guest access (i.e include interactions between guest and the system in your logs) as well as how long you want to Keep logs for. It is recommend that you keep logs for as long as possible (in case you need them and to allow better reporting), however, you may wish to delete logs after an appropriate period to help with your site's performance.
With External database log settings you can configure the desired external log store before selecting which levels and types of actions you wish to be logged. Types of actions are: create, read, update, and delete. The available education levels of actions being: teaching, participating, and other.
Using xAPI with Totara
It is possible to add plugins to Totara so that you can use any xAPI/ Tin Can compliant content you have in a course. This content could be available via an URL or as a package in a zip file, it can then be both integrated into the course and have any actions taken in the activity recorded in an external Learning Record Store (LRS). To achieve this you would also need to add a logstore plugin to Totara that works with an external LRS. Below we will explore how to do both of these things.
xAPI currently requires third-party plugins to work, and is not supported by Totara. These instructions are intended as guidance for those who are happy to proceed with the understanding that the xAPI plugins are not supported by Totara and cannot be guaranteed to work.
To set up xAPI with Totara you will need a Totara Site and a LRS (Learning Record Store), this is a standalone application which can either be installed locally (for example using the open source tool Learning Locker) or you can pay for one (if you're not comfortable setting this up yourself). Additionally, you will also need two plugins: the Logstore xAPI (Moodle plugin) and the xAPI Launch Link (Moodle plugin).
There are two parts of this setup, the Logstore plugin and then the Launch Link plugin.
First, you will need to configure the Logstore xAPI plugin as this can transfers events in your LRS. This can only happen once you have installed the plugin onto your Totara site (guidance on plugin installation can be found within the plugin).
- Configure your chosen LRS, you should be able to find guidance on this from your chosen provider.
- You will need to set up a Client within your LRS, again instructions on this should be available from your LRS provider. You may have a client supplied for you when you create the LRS or you might need to create one.
- Within your Totara site follow the path Site admin > Plugins > Logging > Manage Logstores.
- Configure this for your LRS using the Client details from step 2.
- Finally, click the Save changes button.
Tin Can Launcher
You have now configured the Logstore xAPI plugin. If you start performing actions in your Totara site (such as setting up courses and logging in or out), then go into your LRS you'll notice the statements of events will be transferred into your logstore. In the documentation for the Logstore xAPI plugin, you will find a list of all the supported events that will be transferred.
The second stage is to configure the xAPI Launch Link plugin; this will let you launch compatible xAPI learning from Totara. The steps below take place after the xAPI Launch Link plugin has been installed; instructions on how to do this can be found within the plugin.
- To configure the plugin go to Site admin > Plugins > activity modules > Tin can launch link.
- Add the Client information (as in Logstore configuration above).
- Click the Save changes button.
You can then go to a course and follow these steps:
- On the course Turn editing on.
- Next, click Add an activity and select Tin Can Launch Link.
- Fill in the details as required (mandatory fields marked with an asterisk).
- Click the Save changes button.
Now you can go to the course and launch the Tin Can/ xAPI content you have linked via a package or URL. The details of events carried out in the content (such as launching, attempts made, and completion) will be transferred to your LRS.
It is highly recommended that you use HTTPS for secure transfer of information when using logstore.
It is possible to allow NGINX and other webservers to log username in access logs. When you allow logging by a webserver in the access logs they can send the username as a custom header which can be logged and stripped out if needed.
To configure this just add the variable $CFG->headerloguser to the config.php file. You can read more about this and possible values in config-dist.php.