pgBadger is a PostgreSQL log analyzer built for speed with fully detailed reports and professional rendering. It outperform any other PostgreSQL log analyzer.
pgBadger is able to autodetect your PostgreSQL log file format (syslog, stderr, csvlog or jsonlog) as well as pgbouncer log file. It is designed to parse huge log files as well as gzip compressed file. See a complete list of features below.
All charts are zoomable and can be saved as PNG images.
You can also limit pgBadger to only report errors or remove any part of the report using command line options.
pgBadger supports any custom format set into the log_line_prefix directive of your postgresql.conf file as long as it at least specify a time escape sequence (%t, %m or %n) and the process related escape sequence (%p or %c).
pgBadger allow parallel processing on a single log file and multiple files through the use of the -j or -J options and the number of CPUs as value.
If you want to save system performance you can also use log_duration instead of log_min_duration_statement to have reports on duration and number of queries only.
pgBadger supports an incremental mode that allow to construct incremental reports after successives runs of pgBadger. It is possible to run pgbadger each days or even more, each hours, and have cumulatives reports per day and per week. A top index page will allow you to go directly to the weekly and daily reports.
Version 10.1 - 2018-09-12
This release of pgBadger is a maintenance release that fixes reports in incremental mode and multiprocess with -j option. Log parsing from standard input was also broken. If you are using v10.0 please upgrade now.
- Add test on pgbouncer log parser. - Some little performances improvment. - Fix not a valid file descriptor at pgbadger line 12314. - Fix unwanted newline in progressbar at startup. - Remove circleci files from the project. - Remove dependency of bats and jq for the test suite, they are replaced with Test::Simple and JSON::XS. - Add more tests especially for incremental mode and input from stdin that was broken in release 10.0. - Sync pgbadger, pod, and README, and fix some syntax errors. Thanks to Christoph Berg for the patch. - Add documentation on how to install Perl module JSON::XS from apt and yum repositories. - Fix URI for CSS in incremental mode. Thanks to Floris van Nee for the report. - Fix fatal error when looking for log from STDIN. Thanks to Jacek Szpot for the report. - Fixes SED use for OSX builds. Thanks to Steve Newson for the patch. - Fix illegal division by zero in incrental mode. Thanks to aleszeleny for the report. - Replace SQL::Beautify with v3.1 of pgFormatter::Beautify.
Thanks a lot to Etienne Bersac from Dalibo who have initiate the pgbadger test suite and added information about contributing in the documentation. Unitary tests are still not complete but tests of features fixed in this maintenance release have been added.
Version 10.0 - 2018-09-09
pgBadger 10.0 was released today, this release of pgBadger is a major release that adds some new features and fix all issues reported by users since last release. Every one should upgrade.
* Add support of pgbouncer syslog log file format. * Add support to all auto_explain format (text, xml, json and yaml). * Add support to %q placeholder in log_line_prefix. * Add jsonlog format of Michael Paquier extension, with -f jsonlog pgbadger will be able to parse the log. * Replace the SQL formatter/beautify with v3.0 of pgFormatter.
There is some new command line options:
- Add --prettify-json command line option to prettify JSON output. - Add --log-timezone +/-XX command line option to set the number of hours from GMT of the timezone that must be used to adjust date/time read from log file before beeing parsed. Note that you might still need to adjust the graph timezone using -Z when the client has not the same timezone. - Add --include-time option to add the ability to choose times that you want to see, instead of excluding all the times you do not want to see (--exclude-time).
The pgBadger project and copyrights has been transferred from Dalibo to the author and official maintainer of the project. Please update your links:
- Web site: http://pgbadger.darold.net/ - Source code: https://github.com/darold/pgbadger
I want to thanks the great guys at Dalibo for all their investments into pgBadger during these years and especially Damien Clochard and Jean-paul argudo for their help to promote pgBadger.
For the complete list of changes, please checkout the release note on https://github.com/darold/pgbadger/blob/master/ChangeLog
pgBadger is back to home - 2018-08-28
After one year I'm please to announce that the badger is back to home. A new version is coming soon fixing all pending issues and more as usual. I built a new website tonight for the occasion.
Welcome back home pgBadger!
Version 9.2 - 2017-07-27
This release of pgBadger is a maintenance release that also adds some new features.
* Add report of checkpoint distance and estimate. * Add support of AWS Redshift keywords to SQL code beautifier. * Add autodetection of log format in remote mode to allow remote parsing of pgbouncer log file together with PostgreSQL log file.
There's also some bugs fixes and features enhancements.
Version 9.1 - 2017-01-24
This release of pgBadger is a maintenance release that adds some new features.
* Add report of error class distribution when SQLState is available in the log_line_prefix (see %e placeholder). * Update SQL Beautifier to pgFormatter v1.6 code. * Improve error message normalization. * Add --normalized-only option to generate a text file containing all normalized queries found in a log with count. * Allow %c (session id) to replace %p (pid) as unique session id. * Add waiting for lock messages to event reports. * Add --start-monday option to start calendar weeks in Monday instead of default to Sunday.
There's also some bugs fixes and features enhancements.
- Add report of error class distribution when SQLState is available in the log line prefix. Thanks to jacks33 for the feature request. - Fix incremental global index on resize. Thanks to clomdd for the report. - Fix command tag log_line_prefix placeholder %i to allow space character. - Fix --exclude-line options and removing of obsolete directory when retention is enabled and --noreport is used. - Fix typo in "vacuum activity table". Thanks to Nicolas Gollet for the patch. - Fix autovacuum report. Thanks to Nicolas Gollet for the patch. - Fix author of pgbadger's logo - Damien Cazeils and English in comments. Thanks to Thibaut Madelaine for the patch. - Add information about pgbouncer log format in the -f option. Thanks to clomdd for the report. - Add --normalized-only information in documentation. - Fix broken report of date-time introduced in previous patch. - Fix duration/query association when log_duration=on and log_statement=all. Thanks to Eric Jensen for the report. - Fix normalization of messages about advisory lock. Thanks to Thibaut Madelaine for the report. - Fix report of auto_explain output. Thanks to fch77700 for the report. - Fix unwanted log format auto detection with log entry from stdin. Thanks to Jesus Adolfo Parra for the report. - Add left open parentheses to the "stop" chars of regex to look for db client in the prefix to handle the PostgreSQL client string format that includes source port. Thanks to Jon Nelson for the patch. - Fix some spelling errors. Thanks to Jon Nelson for the patch. - Allow %c (session id) to replace %p (pid) as unique session id. Thanks to Jerryliuk for the report. - Allow pgbadger to parse default log_line_prefix that will be probably used in 10.0: '%m [%p] ' - Fix missing first line with interpreter call. - Fix missing Avg values in CSV report. Thanks to Yosuke Tomita for the report. - Fix error message in autodetect_format() method. - Add --start-monday option to start calendar weeks in Monday instead of default to Sunday. Thanks to Joosep Mae for the feature request. - Fix --histo-average option. Thanks to Yves Martin for the report. - Remove plural form of --ssh-option in documentation. Thanks to mark-a-s for the report. - Fix --exclude-time filter and rewrite code to skip unwanted line as well code to update the progress bar. Thanks to Michael Chesterton for the report. - Fix support to %r placeholder in prefix instead of %h.
Version 9.0 - 2016-09-02
Backward compatibility with old incremental report might be preserved.
Official release are published to the GitHub Release page of pgBadger.
Not all release are subject to a notification sent to the pgsql-announce mailling list, this is reserved to the main releases.
pgBadger may have a binary package corresponding to your distribution. For RPM packages, thanks to the great work of Devrim GÜNDÜZ, you can find the pgBadger package at the PostgreSQL yum repository
Thanks to Christoph BERG packages for Debian and Ubuntu are available in the PostgreSQL apt repository
The latest development code can always be found into the pgBadger's GitHub repository
pgBadger is Free Software and is made fully available free of charge, you can use it as you want without having to pay anything.
Please just pay attention to support the author of pgBadger with your donation, which is purely optional.
PostgreSQL is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
Copyright © 2012-2018 Gilles Darold.
A modified version of the SQL::Beautify Perl Module is embedded in pgBadger with copyright (C) 2009 by Jonas Kramer published under the terms of the Artistic License 2.0.
Source Lines of Perl Code: 14054
Total Estimated Cost to Develop: $454,166
(Generated using David A. Wheeler's 'SLOCCount'.)
Please report any bugs, patches, discussion, etc. using the GitHub tools at https://github.com/darold/pgbadger/.
If you need new features or you think something is missing, please send your comments and requests. This helps a lot to develop a better/useful tool.
Any contribution to build a better tool is welcome, you just have to send your ideas, features request or patches using the GitHub tools at https://github.com/darold/pgbadger/.
For a complete list of commercial support near of your place take a look at the PostgreSQL Professional Services page, they all do great job and most of them can help you.