At work we use Munin as a monitoring tool. Recently I added graphs containing the amount of PHP errors on our servers. The plugin I used is called loggrep and I used the following configuration for it:
[loggrep*] user root env.regex PHP env.label All PHP errors env.regex_notices PHP Notice env.label_notices Notices env.regex_warnings PHP Warning env.label_warnings Warnings env.regex_fatal PHP Fatal env.label_fatal Fatal errors env.regex_deprecated PHP Deprecated env.label_deprecated Deprecated [loggrep_www] env.logfile /var/log/httpd/www.vg.no-error.log env.title PHP errors on www.vg.no
The snippet above is placed in the /etc/munin/plugin-conf.d/loggrep configuration file. In the /etc/munin/plugins directory I put a symbolic link to the loggrep plugin called loggrep_www. This way we can easily have graphs grouped by the different virtual hosts we have on our servers. If we have a host called foo.vg.no and would like a graph of PHP errors on that host I would simply add a section for it in the configuration file that would look like this:
[loggrep_foo] env.logfile /var/log/httpd/foo.vg.no-error.log env.title PHP errors on foo.vg.no
and create a symbolic link called loggrep_foo in the /etc/munin/plugins directory that points to the loggrep plugin.
Here is what the graph looks like: