PostgreSQL Logging
Logging is an important part of your PostgreSQL database monitoring suite, providing historical information for troubleshooting and forensic purposes: which user logged in when, what queries they ran and how long they took, when the database restarted.