How to log PostgreSQL queries?

In your data/postgresql.conf file, change the log_statement setting to 'all'.


Edit

Looking at your new information, I’d say there may be a few other settings to verify:

  • make sure you have turned on the log_destination variable
  • make sure you turn on the logging_collector
  • also make sure that the log_directory directory already exists inside of the data directory, and that the postgres user can write to it.

Leave a Comment