How to log all sql queries performed by Odoo

If you want to see all the queries that Odoo execute while it running, you can do that by setting up in the configuration file –log-level=debug_sql. Also, you can do the same when you start the server by adding the argument –log-level debug_sql in the command line.

For example in Odoo v.10 that would look like:

python odoo/odoo-bin --log-level debug_sql