Most databases have built-in options for query logging and slow query logging, so you do not need to log in through PHP. You do not have to log all requests during the production process unless you have problems, and this is part of the troubleshooting process. You can and should record slow requests so you can see what can slow down your production site.
If your infrastructure supports it, you can only register requests if a page takes a certain amount of time to create (this is what I do). Then you log in conditionally and you may find an excessive number of running requests.
source
share