vendredi 20 mars 2020

Laravel 5.3 log query result?

I'm trying to find out which sql queries are slow in a legacy application of my company, so I'm logging the queries as described at https://laravel.com/docs/5.3/database#listening-for-query-events

DB::listen(function ($query) {
    \Log::info($query->sql);
    \Log::info($query->bindings);
    \Log::info($query->time); //in milliseconds
}

And this works fine. However, it would be interesting to log the actual result of the queries too. Is that possible?

I couldn't find what properties this query variable has, is it just those three? Or can I get the actual result of the query too?

This is the first time I work in php, so assume no knowledge. Thanks a lot!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire