文件位置:app/Providers/AppServiceProvide.php
内容
public function boot()
{
DB::listen(function($query,$bindings,$time){
$query = str_replace(array('%', '?'), array('%%', '%s'), $query);
$query = vsprintf($query, $bindings);
if($time>5){
Log::debug(compact('query','time'));
}
});
...............
}