From bb2067c85159a09e7bcf0ee98e96157da0faeb8f Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 16 Feb 2009 03:00:07 +0000 Subject: [PATCH] database: MDL-18269 query logging behaviour changed in Moodle 1.9 due to internal ADODB changes. --- config-dist.php | 3 +++ lib/setup.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/config-dist.php b/config-dist.php index 98015a15c93..8a47f839ce5 100644 --- a/config-dist.php +++ b/config-dist.php @@ -259,6 +259,9 @@ $CFG->admin = 'admin'; // The following setting will log every database query to a table called adodb_logsql. // Use this setting on a development server only, the table grows quickly! // $CFG->logsql = true; +// By default, only queries that take longer than 0.05 seconds are logged. To change that, +// set the following variable. For example, to lot all queries: +// $CFG->logsqlmintime = 0.0; // // The following setting will turn on username logging into Apache log. For full details regarding setting // up of this function please refer to the install section of the document. diff --git a/lib/setup.php b/lib/setup.php index 2a8591c64a4..30b78123b1c 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -241,6 +241,11 @@ global $HTTPSPAGEREQUIRED; /// Turn on SQL logging if required if (!empty($CFG->logsql)) { $db->LogSQL(); + // And override ADODB's default logging time + if (isset($CFG->logsqlmintime)) { + global $ADODB_PERF_MIN; + $ADODB_PERF_MIN = $CFG->logsqlmintime; + } } /// Prevent warnings from roles when upgrading with debug on