Skip to content

Commit

Permalink
Add note about query logs. Closes laravel#238.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 28, 2013
1 parent 2b6d615 commit 26c9911
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion database.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Running Queries](#running-queries)
- [Database Transactions](#database-transactions)
- [Accessing Connections](#accessing-connections)
- [Query Logging](#query-logging)

<a name="configuration"></a>
## Configuration
Expand Down Expand Up @@ -75,4 +76,11 @@ You may also access the raw, underlying PDO instance:

Sometimes you may need to reconnect to a given database:

DB::reconnect('foo');
DB::reconnect('foo');

<a name="query-logging"></a>
## Query Logging

By default, Laravel keeps a log in memory of all queries that have been run for the current request. However, in some cases, such as when inserting a large number of rows, this can cause the application to use excess memory. To disable the log, you may use the `disableQueryLog` method:

DB::connection()->disableQueryLog();

0 comments on commit 26c9911

Please sign in to comment.