Created
December 27, 2016 07:38
-
-
Save sworup/70c392c8affe090bbf80995a5a6c087d to your computer and use it in GitHub Desktop.
Adding a DB Listener to log the sql query in log file
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
<?php | |
use Illuminate\Support\Facades\Log; | |
\DB::listen(function($sql, $bindings, $time) { | |
Log::info($sql); | |
Log::info($bindings); | |
Log::info($time); | |
}); | |
// Your query goes after this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment