Test the performance or see any errors on Osclass

the new era

Well-known member
Diamond
Elite
XNullUser
Joined
Oct 17, 2021
Messages
190
Reaction score
487
Points
63
Location
UK
NullCash
4,478
Debug SQL queries in Osclass to test the performance or see any errors that ar trigger and how much time is needed for each query to execute. Use this option only to make test but do not leave this option active on your live site to avoid any performance decrease.

In osclass we have available different constants to debug SQL queries:

OSC_DEBUG_DB - will display the queries at the end of the page, you will have some extra information about the query, time execution, and errors if an error occurred

OSC_DEBUG_DB_LOG - will save all the queries in a file queries.log, this useful when you want to debug queries from ajax request or when the cron is running

OSC_DEBUG_DB_EXPLAIN - will save an explain query for each query in a file explain_queries.log, use this option only for development to see the performance of the queries

If Apache doesn't have permission to create this files you need to create the files manually and the permissions 666

/*
* Copy this code to config.php file
*
* This constant will show SQL queries at the bottom of the site
*/
define('OSC_DEBUG_DB', true) ;

/*
* Copy this code to config.php file
*
* This will log all sql to a file called queries.log in oc-content.
*
*/
define('OSC_DEBUG_DB', true) ;
define('OSC_DEBUG_DB_LOG', true) ;

/*
* Copy this code to config.php file
*
* This will run a EXPLAIN sql query for each SELECT sql statement.
* The results will be logged to a file called explain_queries.log in oc-content.
*
*/
define('OSC_DEBUG_DB_EXPLAIN', true) ;
 
Top