Debugging: Difference between revisions

From IOU Bahasa
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 5: Line 5:
== Enable Moodle's Built-in Debugging ==
== Enable Moodle's Built-in Debugging ==
This is the first and most crucial step for any Moodle issue. It forces Moodle to display errors, warnings, and detailed information.
This is the first and most crucial step for any Moodle issue. It forces Moodle to display errors, warnings, and detailed information.
<ol>
 
<li>Log in as an administrator.</li>
#Log in as an administrator.
<li>Go to Site administration > Development > Debugging.</li>
#Go to Site administration > Development > Debugging.
<li>Set the Debug messages dropdown to DEVELOPER. This is the highest level and displays all PHP notices, warnings, and errors.</li>
#Set the Debug messages dropdown to DEVELOPER. This is the highest level and displays all PHP notices, warnings, and errors.
<li>Check the box for Display debug messages.</li>
#Check the box for Display debug messages.
<li>Check the box for Show performance information (optional, but helpful).</li>
#Check the box for Show performance information (optional, but helpful).
<li>Save changes.</li>
#Save changes.
</ol>
 
<p>Once enabled, Moodle will display detailed error messages at the top of the screen (or in the logs) when an issue occurs, often including a stack trace pointing to the file and line number where the problem originated.</p>
Once enabled, Moodle will display detailed error messages at the top of the screen (or in the logs) when an issue occurs, often including a stack trace pointing to the file and line number where the problem originated.

Latest revision as of 02:40, 13 October 2025

Debugging in Moodle involves several techniques, from enabling built-in debugging messages to using developer tools and logging.

Here is a comprehensive guide on how to debug in Moodle, starting with the essential built-in features.

Enable Moodle's Built-in Debugging

[edit]

This is the first and most crucial step for any Moodle issue. It forces Moodle to display errors, warnings, and detailed information.

  1. Log in as an administrator.
  2. Go to Site administration > Development > Debugging.
  3. Set the Debug messages dropdown to DEVELOPER. This is the highest level and displays all PHP notices, warnings, and errors.
  4. Check the box for Display debug messages.
  5. Check the box for Show performance information (optional, but helpful).
  6. Save changes.

Once enabled, Moodle will display detailed error messages at the top of the screen (or in the logs) when an issue occurs, often including a stack trace pointing to the file and line number where the problem originated.