How to Monitor or View PHP Error Logs in WOrdpress

Step by Step solutions on how to monitor error logs in wordpress.

When working with wordpress, you may wish to monitor or dig out some error from the PHP logs. WordPress as a software is written in PHP Programming language. And as the software runs, warnings, notices and errors are being dumped into a text file in realtime. This is for debugging purposes and is standard for any production software. Through these logs developers can quickly identify what is going wrong especially when the website isn't working correctly.

In this tutorial you will find out how to monitor these logs in the dashboard of your site, as an administrator. This saves you from having to search for this file in your server or in the cpanel.

(a). Use Error Log Monitor plugin

Error Log Monitor is a plugin that adds a Dashboard widget that displays the last X lines from your PHP error log, and can also send you email notifications about newly logged errors.

Here are its features:

Features

  • Automatically detects error log location.
  • Explains how to configure PHP error logging if it’s not enabled yet.
  • The number of displayed log entries is configurable.
  • Sends you email notifications about logged errors (optional).
  • Configurable email address and frequency.
  • You can easily clear the log file.
  • The dashboard widget is only visible to administrators.
  • Optimized to work well even with very large log files.

Here is how you install and use it.

Step 1: Install Error Log Monitor

Start by installing the WP User Profile Avatar from the WordPress.org repository.

Step 2: Activate the Plugin

The next step it to activate the plugin from the plugins menu in the dashboard.

Step 3: View Errors

Go to the Dashboard and enable the PHP Error Log widget through the Screen Options panel. The widget should automatically display the last 20 lines from your PHP error log. If you see an error message like “Error logging is disabled” instead, follow the displayed instructions to configure error logging.

Email notifications are disabled by default. To enable them, click the “Configure” link in the top-right corner of the widget and enter your email address in the “Periodically email logged errors to:” box. If desired, you can also change email frequency by selecting the minimum time interval between emails from the “How often to send email” drop-down.

Here is a demo screenshot:

More info

You can find more about this plugin here.

(b). Use Error Log Viewer by BestWebSoft plugin

This is a simple utility plugin that helps you find and view log files with errors right from your WordPress admin dashboard.

Through it you can get access to all your log files from one place. You can view the latest activity, select logs by date, or view a full log file. You can even receive email notifications about log changes.

Here are it's core features:

  • Enable WordPress error logging with:
    • .htaccess
    • wp-config.php using inl_set
    • wp-config.php using WP_DEBUG
  • Search and view error logs:
    • PHP
    • WordPress
  • Configure email notifications about log changes:
    • Set the email
    • Change frequency
  • Configure log monitor settings:
    • Choose the log to be displayed
    • Choose what to show in the log:
      • Certain last lines in the file
      • Log for a certain period of time
      • Full file
  • View or save the part of PHP error logs as TXT file

Step 1: Install it

You can install the plugin by searching for it in the Add Plugin page then clicking install. Or you can download it from here. Then activate it.

Step 2: Use it

You can customize your configuration through Plugin settings which are are located in the Error Log Viewer page. Check the images below to see the plugin in use:

Step 3: More

You can find more information about this plugin here.

Leave a Reply

Your email address will not be published. Required fields are marked *