CodeIgniter Forums
CI logging too many errors - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI logging too many errors (/showthread.php?tid=25628)



CI logging too many errors - El Forum - 12-18-2009

[eluser]fchristant[/eluser]
In my CI config file I have this logging treshold set:

$config['log_threshold'] = 1;

In index.php, I have set the following error reporting:

error_reporting(E_ERROR);

My expectation is that this will log any CI errors that I log (using log_message('error','my error message')), as well as any PHP errors. However, I would expect that it will not log PHP notices, only errors. However, when I look at the log files, it seems to log PHP notices too:

ERROR - 2009-12-18 13:21:50 --> Severity: Notice --> Undefined variable: pageindex /var/www/apps/OS4W/system/application/views/user/view.php 12
ERROR - 2009-12-18 13:21:50 --> Severity: Notice --> Undefined variable: friendsmode /var/www/apps/OS4W/system/application/views/user/activitytable.php 207


Although the log lines start with "ERROR", in reality this seems to be a PHP notice, kind of like a warning, that I do not want to log. How can I make sure only CI and PHP errors are logged, yet not PHP notices? I thought error_reporting(E_ERROR) would do just that?


CI logging too many errors - El Forum - 12-18-2009

[eluser]Whiplash[/eluser]
I think I figured out how to get around this. Here's my possible solution on StackOverflow

http://stackoverflow.com/questions/1928965/code-igniter-logging-too-much


CI logging too many errors - El Forum - 12-21-2009

[eluser]fchristant[/eluser]
I have found a solution that allows for gine grained control over PHP error logging:

http://stackoverflow.com/questions/1928965/code-igniter-logging-too-much/1939053#1939053

It does patch the core, but I have not found any other reliable way to get this control. I hope this helps anyone, thanks for thinking along.