summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2013-03-30 17:40:46 +0100
committerBrice Maron <brice@bmaron.net>2013-03-30 17:40:46 +0100
commit2b8cf4959afc4fdbcf6c6e0f6a3870c7292c1d86 (patch)
tree05a7af51ccace75c142adea030408e37f7eba366 /lib/db.php
parent5e74ec26a89df22a487e1e11cb764e8d4b4e3d9c (diff)
downloadnextcloud-server-2b8cf4959afc4fdbcf6c6e0f6a3870c7292c1d86.tar.gz
nextcloud-server-2b8cf4959afc4fdbcf6c6e0f6a3870c7292c1d86.zip
Log Queries when we add a log query flag
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/db.php b/lib/db.php
index 5a91421f7ab..6bf8c74fce0 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -367,7 +367,9 @@ class OC_DB {
// Optimize the query
$query = self::processQuery( $query );
-
+ if(defined('LOG_QUERIES') && LOG_QUERIES === true) {
+ OC_Log::write('core', 'DB prepare : '.$query, OC_Log::DEBUG);
+ }
self::connect();
// return the result
if(self::$backend==self::BACKEND_MDB2) {
@@ -952,6 +954,10 @@ class PDOStatementWrapper{
* make execute return the result instead of a bool
*/
public function execute($input=array()) {
+ if(defined('LOG_QUERIES') && LOG_QUERIES === true) {
+ $params_str = str_replace("\n"," ",var_export($input,true));
+ OC_Log::write('core', 'DB execute with arguments : '.$params_str, OC_Log::DEBUG);
+ }
$this->lastArguments = $input;
if (count($input) > 0) {