Welcome Guest, Not a member yet? Register   Sign In
Logging db errrors to log file but not showing them in the browser
#3

[eluser]Jonny Noog[/eluser]
Hmm, well as I mentioned in my original post, I've tried setting $db['default']['db_debug'] = FALSE; in database.php. When I do so (and then using the above test code) the output to the browser is:

Quote:An Error Was Encountered

A database error has occured.

Great, that's what I wanted. However, the output to the log file is:

Quote:ERROR - 2009-06-23 10:43:09 --> Database error: Error number: 0

Not helpful at all. The errors are not coming through.

Now if the only change I make is setting $db['default']['db_debug'] = TRUE; in database.php, output to the browser is:

Quote:A Database Error Occurred

Error Number: 1054

Unknown column 'foo' in 'field list'

INSERT INTO `users` (`foo`) VALUES ('bar')

OK that's expected.

Output to the log file is:

Quote:ERROR - 2009-06-23 10:47:21 --> Query error: Unknown column 'foo' in 'field list'

So that's not my code, that's just the standard CI error logging happening. What am I doing wrong?


Messages In This Thread
Logging db errrors to log file but not showing them in the browser - by El Forum - 06-22-2009, 06:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB