CodeIgniter Forums
SQL-query length in log files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: SQL-query length in log files (/showthread.php?tid=80984)



SQL-query length in log files - 5flex - 01-11-2022

Hello.

All errors writing in log files and I get this picture (as example):

PHP Code:
#0 /home/admin/web/xxx.xx/vendor/codeigniter4/framework/system/Database/MySQLi/Connection.php(314): mysqli->query('INSERT INTO cop...') 

For example, in my program code there are 3 very similar database queries in a row and they all start with "INSERT INTO cop ...". Why is there this stupid line cut in the log files? How should I understand in which of the requests the error is? Where can I fix this setting to receive a FULL string request with ALL parameters? Thank you.


RE: SQL-query length in log files - BilltheCat - 01-11-2022

I'm pretty sure this controlled by the error INI options in PHP. You'll notice there's a log_errors_max_len option:


Quote:Set the maximum length of log_errors in bytes. In error_log information about the source is added. The default is 1024 and 0 allows to not apply any maximum length at all. This length is applied to logged errors, displayed errors and also to $php_errormsg.

When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used.

Code:
// Append to the start of your script
ini_set('log_errors_max_len', '0');