- 06 Aug 2024
- 3 minutes to read
Debugging
- Updated on 06 Aug 2024
- 3 minutes to read
Debugging messages can be enabled by a Site Administrator in Quick-access menu > Development > Debugging.
Debugging messages are intended to help diagnose problems and/or help Totara developers. By default Totara does not show any error messages through the interface. If you are having problems (e.g. blank screens or incomplete screens), turning on debugging is usually the first thing to try.
There are two main settings which control debugging output. Display debug messages controls whether debugging messages are displayed in the interface or just recorded in the server logs. Debug messages determines the severity at which a debugging message is displayed or recorded, or otherwise discarded.
For production sites we recommend setting Display debug messages to No, to prevent debugging messages from being displayed to users. Otherwise, this could make the site vulnerable from a security perspective, as debug messages can give clues to a hacker as to the setup of your site.
We recommend production sites set Debug messages to Minimal or Normal. Minimal will ensure that severe problems are logged. Setting to Normal will ensure that minor problems and notices are also logged, but this may cause the server error log to grow rapidly, potentially filling available disk space. In either configuration, ensure that your server logs are properly configured to be purged when appropriate.
If you have a problem with your Totara site and ask for help, a developer may ask you to turn debug messages on, in order to locate the cause of the problem. If debugging must be reproduced on a production site, it is recommended to only increase the level of debugging by setting Debug messages to All or Developer, then returning the setting to its original value after the debugging messages have been recorded in the site logs. On non-production sites, additionally setting Display debug messages to Yes will allow debugging messages to be displayed directly through the interface.
Debugging settings
You can configure the debugging settings by going to Development > Debugging from the Administration block. Remember to click Save changes once you have made any adjustments.
Setting | Description | Notes |
---|---|---|
Debug messages | These are turned off (set to None) by default. You can choose from:
| The Developer level is only recommended if you are a developer, otherwise it is unlikely to have any extra benefits for you, but will cause extra load on the server and slow down the site. |
Display debug messages | Set to On, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies, and HTTP headers in general. Set to Off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to. | - |
Debug email sending | Determines whether or not to enable verbose debug information during sending of email messages to SMTP server. | - |
Performance info | If enabled, performance information will be displayed in the footer (if using the standard theme or some other compatible themes). Performance information includes:
You can the following to your config.php file to include database queries:
| - |
Show origin of language strings | If enabled, language string components and identifiers are displayed when ?strings=1 or &strings=1 is appended to the page URL. This can be helpful for translators. | - |
Show validator links | Enabling this allows links to external validator servers in the page footer. You may need to create a new user with the username 'w3cvalidator', and enable guest access. | These changes may allow unauthorised access to your server and therefore you should not enable on any production sites. |
Show page information | Enabling this will include page information in the page footer. | - |