diff --git a/manifests/globals.pp b/manifests/globals.pp index f3ad15f..5349b3c 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -36,6 +36,7 @@ class postgresql::globals ( $bindir = undef, $xlogdir = undef, $logdir = undef, + $log_line_prefix = undef, $user = undef, $group = undef, diff --git a/manifests/params.pp b/manifests/params.pp index cabe9d9..60331f8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 = [] diff --git a/manifests/server.pp b/manifests/server.pp index 99b87fd..f4fa2f4 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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, diff --git a/manifests/server/config.pp b/manifests/server/config.pp index a1daac8..b00a79b 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -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.