In this article we're going to look at how you can log all database queries that are executed within your Laravel application. There are multiple way in Laravel that help you with debugging your application, such as Debugbar and Telescope.
#default-loggingLaravel has some handle ways of logging in your application this is by using the Log Facade.
This method allows you to listen for any queries that are executed and log them to the log file.
#custom-log-fileIf you want to log all queries to a separate log file you can do this by using the useFiles method on the Log facade.