PostgreSQL Logs Monitoring
Overview
PostgreSQL generates log files which, depending on how logging is configured, can be very useful to understand performance issues at database level (such as slow queries, contention, locks, etc...).
pgBadger
pgBadger is a log analyzer which facilitates reading PostgreSQL logs.
Logs configuration
In order to have data to parse, it requires to configure logs in a determined manner. Information about required settings can be found in pgBadger documentation.
![]() | pgBadger documentation recommends to set log_min_duration_statement to 0 , this generates too much log, it is prefeareably to increase this setting to, at least, 1000 .
|
Note these settings can be useful even when not using pgBadger, just to add extra information to PostgreSQL logs.