Thursday , September 29 2022

pgBadger Installation

In today’s article, we will talk about pgBadger Installation and what it is.

What is pgBadger?

PostgreSQL log analyzer “pgBadger” is an open source PostgreSQL log analysis program written in Perl that takes log output from PostgreSQL instance and processes it into an HTML file.

pgBadger Installation

Operating System : CentOS 7 — PostgreSQL Version : 13

pgBadger Configuration

We make some configuration settings in the postgresql.conf file.

First we set the log_min_duration_statement parameter.

The parameter value is given in milliseconds. A value of “0” ensures that all SQLs are logged.

The log_line_prefix parameter allows detailed information to be written to the log file.

Here, the database name, user name, application and client ip address are also written to the log file.

To get more information in the logs, we need to set the following parameters on.

After the configuration adjustments are completed, we create an index for the reports.

We get the report as follows.

Example: The slowest running queries

Melek Durdu
Author: Melek Durdu

About Melek Durdu

Leave a Reply

Your email address will not be published. Required fields are marked *