Skip to content
pgauditlogtofile

pgauditlogtofile

pgauditlogtofile : pgAudit addon to redirect audit log to an independent file

Overview

ID Extension Package Version Category License Language
7120
pgauditlogtofile
pgauditlogtofile
1.8.3
SEC
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLd-r
No
Yes
Yes
Yes
yes
no
Relationships
See Also
pgaudit
pg_auth_mon
logerrors
pg_permissions
login_hook
set_user
pg_drop_events
table_log

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PGDG
1.8.3
18
17
16
15
14
pgauditlogtofile -
RPM
PGDG
1.8.3
18
17
16
15
14
pgauditlogtofile_$v -
DEB
PGDG
1.8.3
18
17
16
15
14
postgresql-$v-pgauditlogtofile -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
el8.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
el9.x86_64
PGDG 1.8.3
PGDG 1.8.3
PGDG 1.8.3
PGDG 1.8.3
PGDG 1.8.3
el9.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
el10.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
el10.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
d12.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
d12.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
d13.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
d13.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u22.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u22.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u24.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u24.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u26.x86_64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
u26.aarch64
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
PGDG 1.8.4
Package Version OS ORG SIZE File URL
pgauditlogtofile_18 1.8.4 el8.x86_64 pgdg 33.3 KiB pgauditlogtofile_18-1.8.4-1PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.8.3 el8.x86_64 pgdg 32.6 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.8.2 el8.x86_64 pgdg 32.6 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.8.1 el8.x86_64 pgdg 30.0 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.8.0 el8.x86_64 pgdg 30.0 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.7.7 el8.x86_64 pgdg 27.5 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel8.10.x86_64.rpm
pgauditlogtofile_18 1.7.6 el8.x86_64 pgdg 27.0 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel8.x86_64.rpm
pgauditlogtofile_18 1.7.5 el8.x86_64 pgdg 26.8 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel8.x86_64.rpm
pgauditlogtofile_18 1.7.4 el8.x86_64 pgdg 26.6 KiB pgauditlogtofile_18-1.7.4-1PGDG.rhel8.x86_64.rpm
pgauditlogtofile_18 1.8.4 el8.aarch64 pgdg 32.9 KiB pgauditlogtofile_18-1.8.4-1PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.8.3 el8.aarch64 pgdg 32.3 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.8.2 el8.aarch64 pgdg 32.2 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.8.1 el8.aarch64 pgdg 29.6 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.8.0 el8.aarch64 pgdg 29.6 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.7.7 el8.aarch64 pgdg 27.1 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel8.10.aarch64.rpm
pgauditlogtofile_18 1.7.6 el8.aarch64 pgdg 26.6 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel8.aarch64.rpm
pgauditlogtofile_18 1.7.5 el8.aarch64 pgdg 26.4 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel8.aarch64.rpm
pgauditlogtofile_18 1.7.4 el8.aarch64 pgdg 26.2 KiB pgauditlogtofile_18-1.7.4-1PGDG.rhel8.aarch64.rpm
pgauditlogtofile_18 1.8.3 el9.x86_64 pgdg 30.9 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel9.7.x86_64.rpm
pgauditlogtofile_18 1.8.2 el9.x86_64 pgdg 30.7 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel9.7.x86_64.rpm
pgauditlogtofile_18 1.8.1 el9.x86_64 pgdg 28.3 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel9.7.x86_64.rpm
pgauditlogtofile_18 1.8.0 el9.x86_64 pgdg 28.1 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel9.7.x86_64.rpm
pgauditlogtofile_18 1.7.7 el9.x86_64 pgdg 26.2 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel9.7.x86_64.rpm
pgauditlogtofile_18 1.7.6 el9.x86_64 pgdg 25.8 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel9.x86_64.rpm
pgauditlogtofile_18 1.7.5 el9.x86_64 pgdg 25.5 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel9.x86_64.rpm
pgauditlogtofile_18 1.7.3 el9.x86_64 pgdg 25.1 KiB pgauditlogtofile_18-1.7.3-2PGDG.rhel9.x86_64.rpm
pgauditlogtofile_18 1.7.3 el9.x86_64 pgdg 25.0 KiB pgauditlogtofile_18-1.7.3-1PGDG.rhel9.x86_64.rpm
pgauditlogtofile_18 1.8.4 el9.aarch64 pgdg 31.1 KiB pgauditlogtofile_18-1.8.4-1PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.8.3 el9.aarch64 pgdg 30.6 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.8.2 el9.aarch64 pgdg 30.7 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.8.1 el9.aarch64 pgdg 28.1 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.8.0 el9.aarch64 pgdg 28.0 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.7.7 el9.aarch64 pgdg 25.9 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel9.7.aarch64.rpm
pgauditlogtofile_18 1.7.6 el9.aarch64 pgdg 25.4 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel9.aarch64.rpm
pgauditlogtofile_18 1.7.5 el9.aarch64 pgdg 25.1 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel9.aarch64.rpm
pgauditlogtofile_18 1.7.3 el9.aarch64 pgdg 24.8 KiB pgauditlogtofile_18-1.7.3-2PGDG.rhel9.aarch64.rpm
pgauditlogtofile_18 1.7.3 el9.aarch64 pgdg 24.7 KiB pgauditlogtofile_18-1.7.3-1PGDG.rhel9.aarch64.rpm
pgauditlogtofile_18 1.8.4 el10.x86_64 pgdg 31.6 KiB pgauditlogtofile_18-1.8.4-1PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.8.3 el10.x86_64 pgdg 31.0 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.8.2 el10.x86_64 pgdg 31.0 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.8.1 el10.x86_64 pgdg 28.4 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.8.0 el10.x86_64 pgdg 28.2 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.7.7 el10.x86_64 pgdg 26.3 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel10.1.x86_64.rpm
pgauditlogtofile_18 1.7.6 el10.x86_64 pgdg 26.1 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel10.x86_64.rpm
pgauditlogtofile_18 1.7.5 el10.x86_64 pgdg 25.8 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel10.x86_64.rpm
pgauditlogtofile_18 1.7.3 el10.x86_64 pgdg 25.5 KiB pgauditlogtofile_18-1.7.3-2PGDG.rhel10.x86_64.rpm
pgauditlogtofile_18 1.7.3 el10.x86_64 pgdg 25.4 KiB pgauditlogtofile_18-1.7.3-1PGDG.rhel10.x86_64.rpm
pgauditlogtofile_18 1.8.4 el10.aarch64 pgdg 31.5 KiB pgauditlogtofile_18-1.8.4-1PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.8.3 el10.aarch64 pgdg 30.8 KiB pgauditlogtofile_18-1.8.3-1PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.8.2 el10.aarch64 pgdg 31.0 KiB pgauditlogtofile_18-1.8.2-1PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.8.1 el10.aarch64 pgdg 28.4 KiB pgauditlogtofile_18-1.8.1-1PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.8.0 el10.aarch64 pgdg 28.3 KiB pgauditlogtofile_18-1.8.0-1PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.7.7 el10.aarch64 pgdg 26.3 KiB pgauditlogtofile_18-1.7.7-2PGDG.rhel10.1.aarch64.rpm
pgauditlogtofile_18 1.7.6 el10.aarch64 pgdg 26.1 KiB pgauditlogtofile_18-1.7.6-2PGDG.rhel10.aarch64.rpm
pgauditlogtofile_18 1.7.5 el10.aarch64 pgdg 25.8 KiB pgauditlogtofile_18-1.7.5-1PGDG.rhel10.aarch64.rpm
pgauditlogtofile_18 1.7.3 el10.aarch64 pgdg 25.4 KiB pgauditlogtofile_18-1.7.3-2PGDG.rhel10.aarch64.rpm
pgauditlogtofile_18 1.7.3 el10.aarch64 pgdg 25.3 KiB pgauditlogtofile_18-1.7.3-1PGDG.rhel10.aarch64.rpm
postgresql-18-pgauditlogtofile 1.8.4 d12.x86_64 pgdg 66.9 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg12+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.3 d12.x86_64 pgdg 65.4 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg12+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.0 d12.x86_64 pgdg 58.8 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg12+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.4 d12.aarch64 pgdg 65.6 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg12+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.3 d12.aarch64 pgdg 64.4 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg12+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.0 d12.aarch64 pgdg 57.8 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg12+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.4 d13.x86_64 pgdg 67.3 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg13+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.3 d13.x86_64 pgdg 65.9 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg13+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.0 d13.x86_64 pgdg 58.9 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg13+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.4 d13.aarch64 pgdg 66.2 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg13+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.3 d13.aarch64 pgdg 64.9 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg13+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.0 d13.aarch64 pgdg 58.1 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg13+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.4 u22.x86_64 pgdg 67.5 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg22.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.3 u22.x86_64 pgdg 66.2 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg22.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.0 u22.x86_64 pgdg 59.5 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg22.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.4 u22.aarch64 pgdg 65.8 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg22.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.3 u22.aarch64 pgdg 64.6 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg22.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.0 u22.aarch64 pgdg 58.5 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg22.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.4 u24.x86_64 pgdg 66.2 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg24.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.3 u24.x86_64 pgdg 65.0 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg24.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.0 u24.x86_64 pgdg 58.2 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg24.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.4 u24.aarch64 pgdg 64.8 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg24.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.3 u24.aarch64 pgdg 63.6 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg24.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.0 u24.aarch64 pgdg 57.1 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg24.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.4 u26.x86_64 pgdg 65.6 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg26.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.3 u26.x86_64 pgdg 64.4 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg26.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.0 u26.x86_64 pgdg 57.8 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg26.04+1_amd64.deb
postgresql-18-pgauditlogtofile 1.8.4 u26.aarch64 pgdg 64.2 KiB postgresql-18-pgauditlogtofile_1.8.4-1.pgdg26.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.3 u26.aarch64 pgdg 63.2 KiB postgresql-18-pgauditlogtofile_1.8.3-1.pgdg26.04+1_arm64.deb
postgresql-18-pgauditlogtofile 1.8.0 u26.aarch64 pgdg 57.0 KiB postgresql-18-pgauditlogtofile_1.8.0-1.pgdg26.04+1_arm64.deb

Source

Install

Make sure PGDG repo available:

pig repo add pgdg -u    # add pgdg repo and update cache

Install this extension with pig:

pig install pgauditlogtofile;		# install via package name, for the active PG version

pig install pgauditlogtofile -v 18;   # install for PG 18
pig install pgauditlogtofile -v 17;   # install for PG 17
pig install pgauditlogtofile -v 16;   # install for PG 16
pig install pgauditlogtofile -v 15;   # install for PG 15
pig install pgauditlogtofile -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pgauditlogtofile';

Create this extension with:

CREATE EXTENSION pgauditlogtofile;

Usage

pgauditlogtofile: Redirect pgAudit logs to an independent file

pgauditlogtofile is an addon to pgAudit that redirects audit log lines to a separate file instead of the PostgreSQL server log, with automatic rotation support.

CREATE EXTENSION pgauditlogtofile;

Configuration Parameters

Parameter Default Description
pgaudit.log_format csv Output format: csv or json
pgaudit.log_directory log Directory for audit files (empty disables)
pgaudit.log_filename audit-%Y%m%d_%H%M.log Filename pattern (supports time patterns)
pgaudit.log_file_mode 0600 File permissions for audit logs
pgaudit.log_rotation_age 1440 Rotation interval in minutes (1 day)
pgaudit.log_connections off Log connection events (requires log_connections = on)
pgaudit.log_disconnections off Log disconnection events (requires log_disconnections = on)
pgaudit.log_autoclose_minutes 0 Auto-close file handler after N minutes of inactivity
pgaudit.log_execution_time off Measure statement execution time
pgaudit.log_execution_memory off Measure memory footprint of statements

Setup

Add to postgresql.conf:

shared_preload_libraries = 'pgaudit, pgauditlogtofile'
pgaudit.log_directory = 'log'
pgaudit.log_filename = 'audit-%Y%m%d_%H%M.log'
pgaudit.log_rotation_age = 1440

Audit entries are written to the separate file while server logs remain clean.

Last updated on