pepe
pepe

Reputation: 9909

Codeigniter error log file shows errors, but app works fine without error msg on screen - why?

Why would codeigniter show errors in application/logs such as

ERROR - 2011-12-31 11:43:36 --> Severity: Warning  --> Invalid argument supplied for foreach() /var/www/example.com/htdocs/application/views/home/home_vw.php 53


ERROR - 2011-12-31 11:43:36 --> Severity: Notice  --> Undefined variable: questions /var/www/example.com/htdocs/application/views/home/home_vw.php 53

if the methods to which they point to work fine --- and there are no error messages on screen?

My index.php is set at

error_reporting(E_ALL);

and config

$config['log_threshold'] = 1;

Any ideas about the reason for this behavior?

Upvotes: 0

Views: 1150

Answers (1)

Muhammad Usman
Muhammad Usman

Reputation: 12503

The mentioned errors are Warning and Notice, these are not Fatal Error which prevents script from executing further. So you have probability that:

1. Your page is redirecting to a different page so this error warnings disappear before getting printed.

2. The warning is printed but you can't see it, it can happen when it is printed within HTML comments or it is behind any div or so, try view-source to detect in that case.

3. It can also happen when you suppress errors by using @ sign.

Upvotes: 1

Related Questions