Created
March 9, 2015 09:20
-
-
Save rap2hpoutre/54503147e8bbd1abfa6d to your computer and use it in GitHub Desktop.
Log every query in laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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