Merge pull request #754 from xprazak2/timestamps

Adds timestamps into logs by default
This commit is contained in:
David Schmitt 2016-04-05 11:55:37 +01:00
commit bccb77db3f
4 changed files with 11 additions and 0 deletions

View file

@ -36,6 +36,7 @@ class postgresql::globals (
$bindir = undef,
$xlogdir = undef,
$logdir = undef,
$log_line_prefix = undef,
$user = undef,
$group = undef,

View file

@ -4,6 +4,7 @@ class postgresql::params inherits postgresql::globals {
$postgis_version = $postgresql::globals::globals_postgis_version
$listen_addresses = 'localhost'
$port = 5432
$log_line_prefix = '%t '
$ip_mask_deny_postgres_user = '0.0.0.0/0'
$ip_mask_allow_all_users = '127.0.0.1/32'
$ipv4acls = []

View file

@ -38,6 +38,8 @@ class postgresql::server (
$xlogdir = $postgresql::params::xlogdir,
$logdir = $postgresql::params::logdir,
$log_line_prefix = $postgresql::params::log_line_prefix,
$pg_hba_conf_defaults = $postgresql::params::pg_hba_conf_defaults,
$user = $postgresql::params::user,

View file

@ -20,6 +20,7 @@ class postgresql::server::config {
$datadir = $postgresql::server::datadir
$logdir = $postgresql::server::logdir
$service_name = $postgresql::server::service_name
$log_line_prefix = $postgresql::server::log_line_prefix
if ($manage_pg_hba_conf == true) {
# Prepare the main pg_hba file
@ -115,6 +116,12 @@ class postgresql::server::config {
}
}
# Allow timestamps in log by default
if $log_line_prefix {
postgresql::server::config_entry {'log_line_prefix':
value => $log_line_prefix,
}
}
# RedHat-based systems hardcode some PG* variables in the init script, and need to be overriden
# in /etc/sysconfig/pgsql/postgresql. Create a blank file so we can manage it with augeas later.