Another option is GlitchTip
This is to send out an email alert when php hits an out of memory error, copied from an email from ohertel:
/usr/bin/sec I use:
sec - simple event correlator
Command to run in a console
Copy to clipboard
/usr/bin/perl -w /usr/bin/sec -conf=/etc/sec.conf -input=/var/log/php5.log -pid=/var/run/sec.pid -detach -syslog=daemon
Note
In some Debian based systems, the error log might not be at /var/log/php5.log but at /var/log/apache2/error.log
sec.conf looks like this:
Replace email@domain.com with your own email
Copy to clipboard
type=single
continue=takenext
ptype=regexp
pattern=exhausted
desc=scan for tw.o memory errors
action=add php-memory-errors $0
type=calendar
continue=takenext
time=* * * * *
desc=sec cron
context=php-memory-errors
action=report php-memory-errors /usr/bin/mail -s "alert:php out of memory error" email@domain.com; delete php-memory-errors;
pattern=exhausted: 'exhausted' is the string grepped in the logfile.
Another option is ((GlitchTip))
---
This is to send out an email alert when php hits an out of memory error, copied from an email from ohertel:
/usr/bin/sec I use:
sec - simple event correlator
{CODE(colors="bash", wrap="1", caption="Command to run in a console")}
/usr/bin/perl -w /usr/bin/sec -conf=/etc/sec.conf -input=/var/log/php5.log -pid=/var/run/sec.pid -detach -syslog=daemon
{CODE}
__Note__
In some Debian based systems, the error log might not be at __/var/log/php5.log__ but at __/var/log/apache2/error.log__
sec.conf looks like this:
{CODE(caption="Replace email@domain.com with your own email")}type=single
continue=takenext
ptype=regexp
pattern=exhausted
desc=scan for tw.o memory errors
action=add php-memory-errors $0
type=calendar
continue=takenext
time=* * * * *
desc=sec cron
context=php-memory-errors
action=report php-memory-errors /usr/bin/mail -s "alert:php out of memory error" email@domain.com; delete php-memory-errors;
{CODE}
pattern=exhausted: 'exhausted' is the string grepped in the logfile.