Page 1 of 1
error.log file size is increasing
Posted: Tue Apr 20, 2021 7:21 am
by sneha.irali
Hi Team,
As checked I see the below errors been captured on the error.log file under /var/log/httpd/ path.
[Tue Apr 20 01:42:13.237109 2021] [:error] [pid 39680] [client 10.160.113.208:61211] PHP Notice: Undefined variable: allow_html in /usr/local/nagiosxi/html/includes/utils-status.inc.php on line 235, referer:
http://10.x.x.x/nagiosxi/includes/compo ... l&host=abc
[Tue Apr 20 01:42:13.237145 2021] [:error] [pid 39680] [client 10.160.113.208:61211] PHP Notice: Undefined index: problem_acknowledged in /usr/local/nagiosxi/html/includes/utils-status.inc.php on line 183, referer:
http://10.x.x.x/nagiosxi/includes/compo ... l&host=abc
What would be the reason and how do we mitigate it.
Re: error.log file size is increasing
Posted: Tue Apr 20, 2021 3:08 pm
by vtrac
Hi,
I have just asked development team was told that you can actually disable php notices in the php.ini file
I also got the following KB from my boss:
I have tried it on "/etc/php.ini".
I changed my from:
Code: Select all
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
To:
Code: Select all
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
Then restart httpd:
Best Regards,
Vinh
Re: error.log file size is increasing
Posted: Wed Apr 21, 2021 1:36 am
by sneha.irali
I'm little confused here as the Link you sahred me says as below:
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
Then what's the pointing is adding E_NOTICE, isnt its just one level of log we are adding. Correct me if my understanding is wrong.
Re: error.log file size is increasing
Posted: Wed Apr 21, 2021 10:17 am
by vtrac
Hi,
I asked our developers why they do not defined those variable before using them, so that we don't see those errors in the "error_log" file.
Here's the reply I received:
You can actually disable php notices in the php.ini file as well, we don't do it by default
will look at those though as well
I have test by adding the "~E_NOTICE" to the "error_reporting" inside the "/etc/php.ini" file and looks like it did work.
Best Regards,
Vinh
Re: error.log file size is increasing
Posted: Thu Apr 22, 2021 2:14 am
by sneha.irali
Thanks for the info.
However I just want you to know that we have enabled a external REST API Integration to poll the information from Nagios. Can I know if there is any known impact with such kind of integrations additionally I do not find any best practices with REST API Integration, can you help me with it if we have any.
Re: error.log file size is increasing
Posted: Thu Apr 22, 2021 6:24 am
by sneha.irali
Also can you confirm if the file size grows post making the below changes:
I have test by adding the "~E_NOTICE" to the "error_reporting" inside the "/etc/php.ini" file and looks like it did work.
and explain me what E_NOTICE mean.
Re: error.log file size is increasing
Posted: Thu Apr 22, 2021 11:38 am
by vtrac
Hi,
We as support tech work on technical issues, but not programming related. We will try our best to help ...
Since we work on one issue per ticket, please open another forum ticket for API issue(s).
As to "E_NOTICE", I am NOT a PHP programmer, so I checked with development team regarding the error you have posted in the "error_log" file and was told to add E_NOTICE to the php.ini to turn that off.
I google and found:
Code: Select all
In PHP, a variable that doesn't exist will return null rather than causing an error.
Best Regards,
Vinh