diff --git a/application/config/database.php b/application/config/database.php index f4572ed5..55ca839b 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -2,6 +2,20 @@ return array( + /* + |-------------------------------------------------------------------------- + | Database Query Logging + |-------------------------------------------------------------------------- + | + | By default, the SQL, bindings, and execution time are logged in an array + | for you to review. They can be retrieved via the DB::profile() method. + | However, in some situations, you may want to disable logging for + | ultra high-volume database work. You can do so here. + | + */ + + 'profile' => true, + /* |-------------------------------------------------------------------------- | Default Database Connection diff --git a/laravel/database/connection.php b/laravel/database/connection.php index 43abe4e4..1ff34883 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -1,4 +1,4 @@ -log($sql, $bindings, $time); + if (Config::get('database.profile')) + { + $this->log($sql, $bindings, $time); + } return array($statement, $result); }