Enabling PostgreSQL Logging in EventSentry

Article ID: 551
Category: Database
Applies to: 6.0.1.32 and older
Updated: 2026-05-07

If you're troubleshooting database issues with EventSentry and initially installed EventSentry with v6.0.1.32 or earlier, then you may need to enable PostgreSQL file logging so that detailed log files are generated. Follow the steps below to configure file logging.

File Location
By default, the postgresql_eventsentry.conf file (for EventSentry 5.0+ using PostgreSQL v14) is located in:
C:\Program Files\EventSentry\data14 or in the folder where you database is installed.

Steps
1. Open the configuration file as Administrator (or your preferred text editor) as Administrator — this is required to save changes to the file. Then open postgresql_eventsentry.conf from the location above (ensure 'All Files' is selected so that all files are visible).


2. Add the following logging settings to the end of the file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
log_destination = 'stderr'
logging_collector = on
log_directory = 'logs'                    # relative to data dir, or absolute path
log_filename = 'postgresql-%a.log'
log_rotation_age = 1d
log_rotation_size = 100MB
log_truncate_on_rotation = on

log_connections = on        # logs each new connection
log_disconnections = on     # logs session end + duration — this is what you need
log_duration = off          # logs duration of every statement — noisy, skip unless needed
log_min_duration_statement = 10000   # -1 = disabled, or set ms threshold e.g. 1000

log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '

log_error_verbosity = default    # or 'verbose' for more detail
log_min_messages = warning       # keeps noise down but catches errors


3. Save and close the file.
4. Create a "logs" subfolder in the same directory (C:\Program Files\EventSentry\data14). This ensures PostgreSQL has a place to write the log files. The final path should be: C:\Program Files\EventSentry\data14\logs
5. Restart the EventSentry Database v14 service from services.msc
6. Verify the log file after the service restarts, check the new logs subfolder. You should see at least one log file (for example, postgresql-Mon.log).

Note:
Viewing this log file requires administrative privileges, make sure you open your text editor with 'Run as Administrator'.



Try EventSentry on-premise

FREE 30-day evaluation

Download Now