2

I have been searching from a while how can I log the sql queries executed in "laravel/framework": "5.0.*"

But everything I found is about the version 4 , have not found any working solution for 5.0 like these: Get the query executed in Laravel 3/4 and How to get the query executed in Laravel 5 ? DB::getQueryLog returning empty array and http://laravelsnippets.com/snippets/log-db-queries

Some are describe how to use it in laravel 5 but it doesn't seems to be working for me. I just want to write the sql logs in file. That's all, can any one tell me how can I do it.

Many thanks in advance.

Community
  • 1
  • 1
User
  • 23
  • 3

1 Answers1

1

You should enable DB::enableQueryLog(); and you should able to get the query after your middle ware.

Here is the image which explains soundlyenter image description here

Thanks to Mattstauffer

Sulthan Allaudeen
  • 11,330
  • 12
  • 48
  • 63