To get the most out of a log analyzer, such as pgBadger, the log_line_prefix
should be extended to capture additional information than typical default settings.
One suggestion is to use the following:
log_line_prefix = '%t [%p]: [%l] db=%d,user=%u,app=%a,client=%h '
Complete statement data will only be available if log_min_duration_statement=0
is set. This may be prohibitive on busy systems due to the log volumes produced.
Users should also consider enabling pg_stat_statements
and the auto_explain
module for better visibility into database system activity.
Related to