I recently experienced an interesting problem with a Magento web store that went unnoticed because although the store appeared to be functioning perfectly well I was not aware of error reports being created in the Magento /var/report folder. I don’t regularly check this folder and had I known about the error reports that were rapidly accumulating there I could have solved the problem with the store quicker!
I thought it would be a good idea to monitor this folder for new files and to be alerted by email when a change in the folder contents is detected, i.e. when a new error report is generated so that I am aware of Magento errors as soon as they happen.
I put together a quick PHP script and then converted it into a Magento Extension that runs as part of the magento scheduled cron tasks. The extension will check the /var/report folder every hour and send an email alert when a change in this folder is detected with the latest error report file attached.
The extension uses the Magento scheduler which should be enabled. And the Magento scheduler script cron.php should be configured to run periodically in your crontab.
To install the extension, copy the extension app folder to your magento store app folder. Refresh your magento cache. Logout from admin, and login again. Check out your var/reports folder, if you have not checked it for a while there could be reports there, it is quite safe to remove old reports.
The first time the extension runs you will receive an email if there are existing files in your var/report folder showing the total number of reports with the newest report attached. After that you will be alerted each time new reports are detected.
Configure the extension with a valid email addresses, in the My Extensions, Monitor Reports admin section.
Tested with Magento 1.3.x, 1.5.x
PAJ says:
Seems to be a bug in the extension when more than one new report is present, the report is not sent as an attachment correctly.
PAJ says:
Extension updated (v0.2) to try and fix email attachment bug.
RR says:
Will this extension run on 1.6.1?
PAJ says:
Yes it should work fine.
ian says:
hi, do you have to set up cron at all or does it work without it :)?
PAJ says:
You should be running the magento cron.php in your crontab, this manages all the scheduled tasks for Magento.
Wes says:
Thanks for making great solution available free. I’ve run it through the magento extension scoring algorithm http://judge.nr-apps.com/ and it scores it 1/10 for security best practice which makes me a little nervous to install in my store.
Would you consider reviewing some of the security recommendations?
http://judge.nr-apps.com/execution/t/236633ca39cc0604/ (click on get full technical report)
Thanks again