And further to the RTFM recommendation...
https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log
rsyslog.conf(5) FILTER CONDITIONS section
https://www.thegeekdiary.com/etc-rsyslog-conf-setup-a-filter-to-discard-or-r... https://kifarunix.com/a-basic-introduction-to-rsyslog-filters/2/ https://www.usenix.org/system/files/login/articles/06_lang-online.pdf
Gilbert
On 2022-01-24 10:30 a.m., Gilbert E. Detillieux wrote:
On 2022-01-22 1:58 a.m., Trevor Cordes wrote:
On 2022-01-19 Gilbert E. Detillieux wrote:
I'd hold off on making/maintaining your own fork until such a time the PHP brain-trust actually raises things from a warning to an error. In the meantime, if you're logging using rsyslog, it would be fairly easy to add a one-line filter rule to eliminate the needlessly-noisy warning messages. No more full logs, and no more actual serious warnings getting lost like a needle in the haystack!
...
As for your log-filtering idea: it may be the easiest way out for now. However, PHP by default currently logs straight to file. I'm sure there's a syslog option I'll have to explore. I guess it'll add some overhead, but it shouldn't be too much. I didn't know (r)syslog had a filtering option beyond the level-filtering! So does it allow string search or regex or something? Have you used this in the past? A quick example?
It's been a while since I looked into rsyslog filtering (which isn't found in the original syslogd), so I'd recommend you RTFM... But here's an example I did set up some time ago to suppress messages from an overly-chatty Avahi daemon...
/etc/rsyslog.d/avahi.conf:
# Not interested in this noise from avahi... if $programname == 'avahi-daemon' and $msg contains 'Invalid response packet from host' then ~ if $programname == 'avahi-daemon' and $msg contains 'with invalid source port' then ~ if $programname == 'avahi-daemon' and $msg contains 'Packet too short or invalid' then ~ if $programname == 'avahi-daemon' and $msg contains 'Invalid legacy unicast query packet' then ~
Thanks for the input!
You're welcome!
Gilbert