Re: Insane sql logging

2013-01-15 Thread Trevor Joynson
We just parse MySQL binary logs as they only contain modification queries. You can dump the real SQL query out petty easily. I can send you the base of our dump script if you want. On Jan 15, 2013 10:26 AM, "Matteo Suppo" wrote: > Good question. We decided not to do it at

Re: Insane sql logging

2013-01-15 Thread Sam Solomon
The word "Insane" caught my eye and lo and behold it was relevant to what we've done. We actually do this for security reasons and it does help with debugging sometimes (we actually log all queries, not just INSERT/UPDATE/DELETE). We also store fk to user (with a pre_delete hook to unattach

Re: Insane sql logging

2013-01-15 Thread Matteo Suppo
Good question. We decided not to do it at database level because we didn't want to write every select on the file, but only the update/insert/delete. Probably it was better that way, though, and clean the file later. Matteo Suppo - Social Media Badass "C'รจ sempre un altro modo" "Ho l'80% di

Re: Insane sql logging

2013-01-15 Thread Addy Yeow
Why not do this at database level? e.g. using http://dev.mysql.com/doc/refman/5.1/en/query-log.html On Tue, Jan 15, 2013 at 9:35 PM, Matteo Suppo wrote: > Sometimes people ask for strange features, like "I want to log every > database query except select". > > There will

Insane sql logging

2013-01-15 Thread Matteo Suppo
Sometimes people ask for strange features, like "I want to log every database query except select". There will be drawbacks, of course: it will be slower, for example, but they won't care. It happened to us, and we had to ship this insanity: import logging from logging.handlers import