Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Add a configuration option to disable the query log #737

Closed
astoltz opened this issue Mar 27, 2013 · 6 comments
Closed

[Request] Add a configuration option to disable the query log #737

astoltz opened this issue Mar 27, 2013 · 6 comments

Comments

@astoltz
Copy link

astoltz commented Mar 27, 2013

I'm using artisan and Eloquent to do processing of a large number of database updates. Illuminate\Database\Connection tracks each query in Connection::$queryLog. This is problematic for me due to the number of queries and memory limits. I currently work around this by explicitly calling Connection::flushQueryLog(), however it would be nice to have an option to disable this for things like artisan. Having it configured as a part of the environment might be another nice option.

@taylorotwell
Copy link
Member

Added a disableQueryLog method. You can add this to your start/artisan.php file:

DB::disableQueryLog();

@deb0rian
Copy link

Saved my life... I'm not sure why it's enabled by default, I spent hours trying to figure out what eats all my memory when trying to parse 25,000 XML files.

@ipalaus
Copy link
Contributor

ipalaus commented Jan 13, 2014

My bootstrap/production.php disables the query log by default.

On Mon, Jan 13, 2014 at 4:21 PM, Boris Lapouga notifications@github.comwrote:

Saved my life... I'm not sure why it's enabled by default, I spent hours
trying to figure out what eats all my memory when trying to parse 25,000
XML files.


Reply to this email directly or view it on GitHubhttps://github.com//issues/737#issuecomment-32178209
.

Isern Palaus
http://ipalaus.com

@garygreen
Copy link
Contributor

Massive +1 to this. Annoying that this isn't off by default in 4.2, fixed a huge memory leak I was having.

@dciancu
Copy link
Contributor

dciancu commented Feb 23, 2016

👍

@Elemberg
Copy link

👍 2 hours looking for a memory leak in my command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants