Skip to content

Commit 26c9911

Browse files
committed
Add note about query logs. Closes laravel#238.
1 parent 2b6d615 commit 26c9911

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

database.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [Running Queries](#running-queries)
55
- [Database Transactions](#database-transactions)
66
- [Accessing Connections](#accessing-connections)
7+
- [Query Logging](#query-logging)
78

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

7677
Sometimes you may need to reconnect to a given database:
7778

78-
DB::reconnect('foo');
79+
DB::reconnect('foo');
80+
81+
<a name="query-logging"></a>
82+
## Query Logging
83+
84+
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:
85+
86+
DB::connection()->disableQueryLog();

0 commit comments

Comments
 (0)