pg_journal 0.1.0

This Release
pg_journal 0.1.0
Date
Status
Testing
Latest Stable
pg_journal 0.2.0 —
Other Releases
Abstract
Log to systemd journal
Description
Sends logged messages to the systemd journal
Released By
intgr
License
PostgreSQL
Resources
Special Files
Tags

Extensions

Documentation

pg_journal
pg_journal

README

pg_journal

This is a PostgreSQL preload module for sending log messages directly to the systemd journal log.

Prerequisites:

  • PostgreSQL version 9.2+ (earlier versions supported with a server patch).
  • systemd v38 or newer with libsystemd-journal installed.

Installation

To use this module, you need PostgreSQL version 9.2 or later. To use with earlier versions, you need to patch and build your server manually. The necessary patch is included under patches/logging-hooks.patch (courtesy of Martin Pihlak).

You also need a recent enough version of systemd (v38+) with the journal feature and library (libsystemd-journal.so) enabled.

After satisfying these requirements, just do this:

make
make install

If you encounter an error such as:

"Makefile", line 8: Need an operator

You need to use GNU make, which may well be installed on your system as gmake:

gmake
gmake install

If you encounter an error such as:

make: pg_config: Command not found

Be sure that you have pg_config installed and in your path. If you used a package management system such as RPM to install PostgreSQL, be sure that the -devel package is also installed. If necessary tell the build process where to find it:

env PG_CONFIG=/path/to/pg_config make && make install

Once pg_journal is installed, you can enable it in your configuration file. Find the postgresql.conf file (usually in your PostgreSQL data directory) and add the following line:

shared_preload_libaries = 'pg_journal'

You need to restart your server for this to take effect. After that, log messages are automatically sent to journal.

For more details, please see the doc/pg_journal documentation file.

Copyright and License

Copyright (c) 2012 Marti Raudsepp

pg_journal and all related files are available under The PostgreSQL License