How to log MySQL errors to the error file?

#1
[eluser]MatteMatte[/eluser]
Hi Guys,

I have a website powered by CI. In CI, three connections are being made to three different databases at the same time. I wonder how can I log MySQL errors occurring to the log file from all those 3 database connections?

Following config parameters are already set and enabled:

Code:
$config['log_threshold'] = 1;
$config['log_path'] = '/path/to/log/dir';
Any suggestions?

#2
[eluser]WanWizard[/eluser]
Modify the display_error() method of DB_driver to write the error to the logfile?

Or alter the error_db.php error file to write a log entry if you don't feel like modifing core classes.

#3
[eluser]MatteMatte[/eluser]
[quote author="WanWizard" date="1280762234"]Modify the display_error() method of DB_driver to write the error to the logfile?

Or alter the error_db.php error file to write a log entry if you don't feel like modifing core classes.[/quote]

Thanks for your reply WanWizard. In db connection config, "$db['default']['db_debug']" is set to false. Will display_error() of DB_driver be triggered once $db['default']['db_debug'] is set to false?

Thanks!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.