I'm having a dilemma on whether or not to log SQL queries in production as well.
I don't know how slow writing files is in PHP. Probably some benchmarks could give some answers, but I wanted to see what you guys think before.
What does or does not make the process slow? Or what things could it depend on?
Most databases have built-in options for logging queries and slow queries, so you shouldn't need log through PHP. You should not log all queries in production unless you are having problems and it's part of a troubleshooting process. You can and should log slow queries so you can see what may be slowing down your production site.
If you framework supports it, you can log queries only if the page took a certain amount of time to generate (this is what I do). Then you are logging conditionally and may discover an excessive number of queries being run.
You have a couple options:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With