I can only assume this is the reason as there are a lot of DB queries happening on my site and I am not familiar with Laravel My server memory is increasing constantly to the point of the server dying so is there a way to disable the query logging completely without editing every page that is doing DB queries?
3 Answers
You can disable query logs like this:
For single connection:
DB::connection('CONNECTION_NAME')->disableQueryLog();
For whole DB:
DB::disableQueryLog();
Documentation:
https://laravel.com/api/5.8/Illuminate/Database/Connection.html#method_disableQueryLog
Comments
Search the project for: enableQueryLog then remove it. https://laravel.com/docs/5.0/database#query-logging
You might also want to visit storage/logs and clear those out.
9 Comments
user1011585
sorry should have said, this is v4.0
admcfajn
4.2 has
DB::connection()->disableQueryLog(); 4.0 though, not 100% sure. Have you tried searching the project for Log::?user1011585
Actually 4.1. Added DB::disableQueryLog(); DB::connection()->disableQueryLog(); to artisan.php - made no difference. dunno how you add code here
user1011585
Every new page that is visited I see the server buff/cache memory go up and up and up.
admcfajn
Might not be artisan.php - what about adding it to your controller(s)?
|