On Centos7 With PHP 7 configured to send errors to syslog, parse errors get broadcast to wall e.g. logged in users see messages like this:
Broadcast message from systemd-journald@xxxxxxxxxx (Fri 2017-03-03 22:29:05 UTC): httpd: PHP Parse error: Invalid numeric literal in /web/test.php on line 20
I would like to trap these messages and prevent them going to wall. I've tried this Rsyslog config:
user.* /var/log/php.log & stop
however it did not prevent the broadcast messages. Editing
/etc/systemd/journald.conf to include
ForwardToWall=no prevents the broadcast message... The problem is it prevents all emergency messages being displayed which is not desirable.
How can I prevent PHP parse errors being broadcast, but allow other critical system messages to be logged to console?