The last few days I've been trying to performance-tune one of our applications. Being database intensive, it was only naturally to try to optimize database queries.
To enable query logging, postgresql configuration should be updated like this. Note the configuration folder on Centos 7 distribution.

In the postgresql.conf file, next lines under "ERROR REPORTING AND LOGGING" section need to be modified.