# Turn PostgreSQL logs into incident and tuning reports with pgBadger

> Use pgBadger when an agent needs to convert raw PostgreSQL logs into readable evidence about slow queries, errors, and workload hotspots after an incident.

- Skill: `agentskillexchange/turn-postgresql-logs-into-incident-and-tuning-reports-with-p` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/turn-postgresql-logs-into-incident-and-tuning-reports-with-p`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/turn-postgresql-logs-into-incident-and-tuning-reports-with-p/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/turn-postgresql-logs-into-incident-and-tuning-reports-with-p

---


# Turn PostgreSQL logs into incident and tuning reports with pgBadger

Use pgBadger when an agent needs to convert raw PostgreSQL logs into readable evidence about slow queries, errors, and workload hotspots after an incident.

## Prerequisites

pgBadger, PostgreSQL logs with compatible log settings, and a shell environment for report generation.

## Installation

Use the upstream install or setup path that matches your environment:
- make && sudo make install

Requirements and caveats from upstream:
- Requires incremental output directories and the
- month. Requires incremental output directories and
- You must enable and set some configuration directives in your postgresql.conf

Basic usage or getting-started notes:
- PostgreSQL log analyzer with fully detailed reports and graphs.
- Arguments:
- logfile can be a single log file, a list of files, or a shell command

- Source: https://github.com/darold/pgbadger
- Extracted from upstream docs: https://raw.githubusercontent.com/darold/pgbadger/HEAD/README.md

## Documentation

- https://pgbadger.darold.net/

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/turn-postgresql-logs-into-incident-and-tuning-reports-with-pgbadger/)

