O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Producing a daily summary of logfile errors

PostgreSQL can generate gigabytes of logs per day. Lots of data is good in case you want to investigate some specific event, but it is not what you will use for daily monitoring of database health.

Getting ready

Make sure that your PostgreSQL is set up to rotate the log files daily.

A default setup will do exactly the following:

log_rotation_age = 1d

Then get a PostgreSQL log processing program. Here, we describe how to do it using pgFouine.

For most Linux systems, you should be able to use your default package manager to install pgFouine.

Configure your PostgreSQL to produce logfiles in a format that pgFouine understands. Select logging to syslog. Use a modern version of syslogd for high-traffic databases. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required