Welcome Guest, Not a member yet? Register   Sign In
Catch database errors in production mode
#1

[eluser]Unknown[/eluser]
Hi

I'm actually worried about the maintenance of my app when I'll turn it to production mode. I've a problem with catching queries errors when I set my database_debug to false.

Indeed, the function _error_message() from DB library doesn't work.

For example, I tried this :
Code:
//insertion dans la table
  if(!$this->db_log->insert('L_USER_LOGIN_UL',$data))
  {
   echo $this->db_log->_error_message();
  }

With wrong column's name in the query.

However, I've nothing on the screen... The objective is to catch errors and put it into a log file to 'repair' queries and other stuff during maintenance

Thanks for answers, it would help me a lot
Matt
#2

[eluser]TheFuzzy0ne[/eluser]
Where did you get your db_log library? I've never seen it before.

If you enable logging, you should find that logging errors to a text file is ample. However, there shouldn't be many errors on your live site, if you've tested it correctly during development.
#3

[eluser]Unknown[/eluser]
Hey

db_log is the name of my databse for user logs (ip, data) just in order to reduce the number of fake accounts on my website
#4

[eluser]TheFuzzy0ne[/eluser]
Please could your post your model code? I can see what you're trying to do, but I can't see how you're trying to do it.




Theme © iAndrew 2016 - Forum software by © MyBB