After taking a deep look at the system views provided by PostgreSQL, it is time to configure logging. Fortunately, PostgreSQL provides easy means to work with log files and helps people to set up a good configuration easily. Collecting log is important because it can point to errors and potential database problems.
The postgresql.conf file has all the parameters you need to provide you with all the parameters.