Error Log Monitor

Whether you’re using WordPress for development or simply as a blog or CMS, it is always a good idea to keep an eye on your PHP error log.

  • As a developer, it helps you notice and fix errors in your code.
  • As a normal user, it lets you discover plugin bugs, WordPress compatibility issues and other problems that may be affecting your site, so that you can fix them before they seriously hurt your readers and your search engine rankings.

That’s why I’ve created Error Log Monitor – a plugin that lets you easily view the most recent messages from your PHP error log in your Dashboard, and can even send you automatic email notifications about new errors.

Features

  • Dashboard widget displays the most recent messages from your PHP error log.
  • Automatically detects the location of the log file.
  • Provides instructions for setting up error logging if it’s not enabled yet.
  • Periodically checks the log for new errors and emails them to you.
  • Configurable email address and email frequency (from every 10 minutes to weekly).
  • Configurable number of lines to display.
  • Lets you easily clear the log file.
  • The dashboard widget is only visible to administrators.

Screenshots

The PHP error log Dashboard widget with some error messages

Widget configuration screen

Download

Download the latest version from WordPress.org

The plugin requires WordPress 4.5 or later.

Installation

  1. Upload and activate the plugin as usual.
  2. Go to your Dashboard and enable the “PHP Error Log” widget through the “Screen Options” panel.
  3. The widget should automatically display the last 20 lines from your error log. If you haven’t configured error logging yet, it will instead display instructions on how to do that.
  4. (Optional) To enable email notifications, go to widget configuration and enter your email address in the appropriate field.
  5. That’s it.

Notes

Before writing this plugin, I researched and tried a number of existing error reporting plugins. Unfortunately, most of them were either seriously out of date (no updates for more than two years), or didn’t support email notifications, which was the main feature I was looking for. So I decided to build my own.

Related posts :

40 Responses to “Error Log Monitor”

  1. A nice idea; thanks a lot. I’m a little concerned about performance though; does it monitor it “real time” or at set intervals?

  2. Jānis Elsts says:

    It checks the error log at set intervals. You can set how often it does that in the widget configuration.

    It also loads the latest log entries every time you refresh the Dashboard page, but that shouldn’t be much of a performance concern. The plugin is designed to only read the last X lines from the log, not the entire file, so it should be fast even with multi-megabyte logs.

  3. Max says:

    Looks interesting. Will it be available in the official WP repository?

  4. Jānis Elsts says:

    Yes, it will. I’ve already submitted the inclusion request.

  5. Jānis Elsts says:

    Update: It’s available in the WP repository now. See here:
    http://wordpress.org/extend/plugins/error-log-monitor/

  6. […] Error Log Monitor adds a Dashboard widget that displays the latest messages from the PHP error log. […]

  7. […] Error Log Monitor adds a Dashboard widget that displays the latest messages from the PHP error log. […]

  8. […] Error Log Monitor adds a Dashboard widget that displays the latest messages from the PHP error log. […]

  9. […] Error Log Monitor adds a Dashboard widget that displays the latest messages from the PHP error log. […]

  10. Arthur says:

    wow, this is impressive, saves a lot of time

  11. Rodney says:

    How do I find the widget configuration?

  12. Jānis Elsts says:

    Move your mouse cursor over the widget header (“Error Log Monitor”) and a “Configure” link will show up at the top right edge.

  13. Tony says:

    its saying to me does not exist or is inaccessible the log file yet I have it pointing to the log file.

  14. Tony says:

    What permission should be set 744?

  15. Jānis Elsts says:

    744 should work. The plugin itself just needs read access. Depending on your server configuration, PHP may need additional permissions to be able to write error messages to the log file.

    its saying to me does not exist or is inaccessible the log file yet I have it pointing to the log file.

    Could you elaborate on that? If it says the file doesn’t exist, how do you know it’s pointing to the right file?

  16. Tony says:

    im on go daddy I had a php.ini but they did something and it was giving me errors. what would I add to php.ini? I added this to the file it told me to
    ini_set(‘log_errors’, ‘On’);
    ini_set(‘error_log’, ‘/public_html/abovethefirehouse.com/error/php-errors.log’);

  17. Jānis Elsts says:

    Assuming that the filename is correct, the file exists and it’s owner matches the user that the web server/PHP runs as, it should work.

  18. Tony says:

    im not that good at this lol

  19. Tony says:

    oh im on shared hosting

  20. Tony says:

    IM trying to figure why I get http errors when I upload large files in wordpress and it give this error when it crunches

Leave a Reply