PostgreSQL


PostgreSQL is a powerful, open source object-relational database system.

Integration of PostgreSQL on Ubuntu with DNIF Adapter.

To forward PostgreSQL logs to the DNIF Adapter make the following configuration

Log in to the server that hosts PostgreSQL, as the root user.

Install syslog package, if you haven’t installed it

apt-get install rsyslog

Edit PostreSQL configuration with vim /etc/postgresql/9.3/main/postgresql.conf file and uncomment the following lines:

log_destination = 'syslog'
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
client_min_messages = notice
log_min_messages = warning
log_min_error_statement = error
log_min_duration_statement = -1
log_statement = 'all'
log_connections = on
log_disconnections = on
log_hostname = on
log_line_prefix = '%t'

Save and Quit the configuration file.

Restart the postgresql service

service postgresql restart

Edit the syslog configuration file.

vim /etc/rsyslog.d/50-default.conf

Add the following information to syslog configuration file:

##For System logs
*.*		@DNIF-Adapter-IP:514

##For PostgreSQL logs
lOCAL0.*	@DNIF-Adapter-IP:514

Save the syslog configuration file.

PostgreSQL logs are now being streamed to the DNIF-ADAPTER.

Integration of PostgreSQL on CentOS-RHEL with DNIF Adapter.

To forward PostgreSQL logs to the DNIF Adapter make the following configuration

Log in to the server that hosts PostgreSQL, as the root user.

Install syslog package, if you haven’t installed it

yum -y install rsyslog

Edit PostreSQL configuration with vim /etc/postgresql/9.3/main/postgresql.conf file and uncomment the following lines:

log_destination = 'syslog'
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
client_min_messages = notice
log_min_messages = warning
log_min_error_statement = error
log_min_duration_statement = -1
log_statement = 'all'
log_connections = on
log_disconnections = on
log_hostname = on
log_line_prefix = '%t'

Save and Quit the configuration file.

Restart the postgresql service

service postgresql restart

Edit the syslog configuration file.

vim /etc/rsyslog.conf

Add the following information to syslog configuration file:

##For System logs
*.*		@DNIF-Adapter-IP:514

##For PostgreSQL logs
lOCAL0.*	@DNIF-Adapter-IP:514

Save the syslog configuration file.

PostgreSQL logs are now being streamed to the DNIF-ADAPTER.