By default, PostgreSQL only provides minimal audit log history in its files. The following changes to the PostgreSQL configuration file can generate a more robust and useful log file history should it be needed. To enable this more robust audit log history for the database, contact our support team to help you set this up, or to do this yourself, use a text editor to edit the postgresql.conf file (located in the Program Files/PostgreSQL/[#]/data folder).
-
- Open File Explorer and navigate to the PostgreSQL data folder. (Program Files/PostgreSQL/[#]/data)
- Find the postgres.conf file, right-click on it, and Edit with Notepad (or any text editor).
- Locate the log_min_messages parameter (line 495), uncomment it (remove the #) and set it to log.
- Locate the log_connections parameter (line 560), uncomment it (remove the #) and set it to 1.
- Locate the log_disconnections parameter (line 561), uncomment it (remove the #) and set it to 1.
- Locate the log_line_prefix parameter (line 565), and set it to '[USER:%u] [TIME:%t] [DB:%d]'.
- Locate the log_statement parameter (line 598), uncomment it (remove the #) and set it to all.
- Restart the PostgreSQL service (open Windows Services, locate and select postgresql, and select restart).
- The activity log is located in the PostgreSQL log folder (Program Files/PostgreSQL/[#]/data/log).