At a glance
| Database engines | PostgreSQL (self-managed, RDS, Cloud SQL, CloudNativePG logs), PgBouncer, Redshift logs |
| Deployment | A Perl script run on any machine that can read the log files |
| Collection/agents | No agent; reads PostgreSQL log files after the fact |
| Alerting | None |
| Query monitoring | Slow and frequent query reports built from logged statements |
| Licensing | PostgreSQL Licence |
pgBadger is the standard free way to get a workload report out of PostgreSQL logs: slowest and most frequent queries, errors, locks, temporary files, checkpoints and autovacuum. It analyses past logs rather than watching servers live, has no alerting, and its output is only as good as your logging settings.
Overview
pgBadger is a PostgreSQL log analyser maintained by Gilles Darold and distributed under the PostgreSQL Licence. It is a single Perl script with no dependencies beyond a modern Perl distribution, plus optional modules for CSV log parsing (Text::CSV_XS) and JSON output (JSON::XS). Version 13.3 was released on 3 November 2026.
You point pgBadger at log files and it produces a report, HTML by default, with text, JSON and binary outputs also available. It reads stderr, syslog, csvlog and jsonlog formats, Amazon RDS and CloudWatch logs, PgBouncer logs, Heroku logplex and Redshift logs, and parses Cloud SQL and CloudNativePG logs through its jsonlog format. Useful reports need PostgreSQL logging configured for it, for example log_min_duration_statement and a suitable log_line_prefix.
Key features
- Reports on the slowest queries, the most frequent queries and the queries with the most total time
- Hourly charts for temporary files, checkpoints, autovacuum and autoanalyze, errors and cancelled queries
- Breakdowns of locks, query types, sessions and connections, plus PgBouncer statistics
- Incremental mode (-I) producing a report per day and a cumulative report per week
- Parallel parsing of one large log file (-j) or several files at once (-J)
- Auto-detection of stderr, syslog, csvlog and jsonlog, with RDS, CloudWatch, Redshift and logplex formats
- Output as HTML, text, JSON or binary files for later aggregation
Pros and cons
Pros
- Free, with nothing to keep running between reports
- Very little to install: a single Perl script
- Wide log format support, including RDS and CloudWatch logs
- Incremental and parallel modes for large or continuous log volumes
Cons
- Analyses past logs; no live monitoring or alerting
- Report detail depends on logging settings, and logging every statement adds log volume
- Parallel processing does not work with compressed files, CSV logs or on Windows
- PostgreSQL only
Pricing
pgBadger is free and open source, distributed under the PostgreSQL Licence. There is no paid edition and no licence fee.
Pricing checked on the vendor's official page on 7 November 2026. Prices change; confirm before buying.
Who it is best for
PostgreSQL DBAs who want periodic workload, error and maintenance reports from logs without running a monitoring server.
Who should look elsewhere
- Teams that need live dashboards and alerts: see pgwatch or PostgreSQL monitoring tools.
- Anyone wanting an admin GUI with live activity views: see pgAdmin vs pgBadger.
Verdict
pgBadger remains a useful free tool for PostgreSQL: it turns raw logs into a readable report with almost no setup. It complements rather than replaces a live monitor, since it has no alerting and only sees what your logging settings capture.
Frequently asked questions
Is pgBadger free?
Yes. pgBadger is distributed under the PostgreSQL Licence and has no paid edition.
Can pgBadger read Amazon RDS logs?
Yes. The README says pgBadger can auto-detect RDS and CloudWatch PostgreSQL logs using its rds format.
Does pgBadger monitor PostgreSQL in real time?
No. It analyses log files that already exist. Incremental mode can run it on a schedule to build daily and weekly reports, but it does not alert.
Sources
Checked November 2026.
How we research reviews and what star ratings mean: our editorial method.