Is it possible to prevent logging of a specific type of PHP warning? I do not want to disable warnings entirely, I just want to disable error logging of things like this:
[Wed May 12 11:20:17.630952 2021] [:error] [pid 25301] [client 127.0.0.1:57710] PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'apache'@'localhost' (using password: NO) in /www/public_html/example.com/myphpfile.php on line 11, referer: https://example.com/anotherfile.php
while keeping warnings like this one:
[Wed May 12 11:23:21.355798 2021] [:error] [pid 21467] [client 127.0.0.1:49508] PHP Warning: Illegal string offset 'someindex' in /www/public_html/example.com/index.php on line 296, referer: https://example.com/somescript.php?param=1234
My error_reporting
line in /etc/php.ini
looks like this:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE