After taking a deep look at the system views provided by PostgreSQL, it is time to configure logging. Fortunately, PostgreSQL provides an easy way to work with log files and helps people set up a good configuration easily.
Collecting logs 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 necessary information.