Skip to content

Instantly share code, notes, and snippets.

@rap2hpoutre
Created March 9, 2015 09:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rap2hpoutre/54503147e8bbd1abfa6d to your computer and use it in GitHub Desktop.
Log every query in laravel
// Add this in boot method of EventServiceProvider
if (!\App::runningInConsole()) {
\DB::listen(
function ($sql, $bindings, $time) {
\Log::info('QUERY', [$sql, $bindings, $time]);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment