[Answer]-How to log SQL requests posted by a django application?

1👍

Use the log_min_duration option in the configuration file:

http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-MIN-DURATION-STATEMENT

You might also want to install the auto-explain module which will also dump the execution plan of the slow queries to the log file.

More details here: http://www.postgresql.org/docs/current/static/auto-explain.html

Leave a comment