I have a Drupal based webapp that is open for a segment of time during the school quarter. My confidence is high there are few logic, or data integrity issues with the site at the point … but I’d like extra assurances that if an error occurs on the site I’m notified ASAP.
Recently I found the Logging and Alerts module for Drupal 7. There are many similar modules for Drupal 7/6. But this one I know is maintained in part by core developers and is solid at version 2.2 for Drupal 7. It seems slim and having been using it in production over the weekend, it’s OK for my needs.
The logging and alerts module allows you to (taken from the module project page):
- Email logging and alerts
Allows routing of watchdog messages to various email addresses, based on their severity levels. For example, emergency and critical messages need to go to a pager or mobile phone email address, while debug messages go nowhere.
- Web server logging
Allows routing of watchdog messages to the web server’s error log. Note that what is in your PHP configuration for error_log defines where the message will go. For example, on a UNIX like system, this will be syslog(3), which may end up in /var/log/apache2/error.log, and on Windows, it would be the event log. You define which severity levels are to go to the error log. For example, you can only specify that emergency and critical messages need to go to the error log, and use other modules for the other levels.
- Watchdog triggers
Provides a trigger for watchdog events. You may now trigger actions when an event occurs.
- Watchdog rules
Provides rules integration for watchdog events. You may now trigger additional ruleset responses when an event occurs.
I have used this on my site to notify of these events on the site, with the following configuration for this module:
In doing so I get an email such as the following information:
subject:  Warning: student/my-surveys/submission/286309
Site: https://myapplication.example/ Severity: Warning (4) Timestamp: 2014-05-25 22:37:24 Type: access denied IP Address: 188.8.131.52 Request URI: https://myapplication.example/student/my-surveys/submission/286309 Referrer URI: User: Anonymous (0) Link: Message: student/my-surveys/submission/286309 $_REQUEST => Array ( ) $_SESSION => Array ( ) debug_backtrace() => Array (  => Array ( [file] => /var/www/app/htdocs/sites/all/modules/logging_alerts/emaillog/emaillog.module [line] => 115 [function] => eval )  => Array ( [function] => emaillog_watchdog [args] => array(11) ) # ... More debug stacktrace here ... )
The subject and body of the email are designed essentially for developer usage. They simply tell me the severity of the problem and a small look at the state of the system when the error occurred.
I haven’t had any huge issues — but it’s very useful diagnostic info with very little setup or worry of breaking my application by enabling it! I highly recommend this simple, powerful module.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!