Skip to content

Commit bccb77d

Browse files
committed
Merge pull request puppetlabs#754 from xprazak2/timestamps
Adds timestamps into logs by default
2 parents 2527dc2 + b2cb2df commit bccb77d

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

manifests/globals.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
$bindir = undef,
3737
$xlogdir = undef,
3838
$logdir = undef,
39+
$log_line_prefix = undef,
3940

4041
$user = undef,
4142
$group = undef,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
$postgis_version = $postgresql::globals::globals_postgis_version
55
$listen_addresses = 'localhost'
66
$port = 5432
7+
$log_line_prefix = '%t '
78
$ip_mask_deny_postgres_user = '0.0.0.0/0'
89
$ip_mask_allow_all_users = '127.0.0.1/32'
910
$ipv4acls = []

manifests/server.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
$xlogdir = $postgresql::params::xlogdir,
3939
$logdir = $postgresql::params::logdir,
4040

41+
$log_line_prefix = $postgresql::params::log_line_prefix,
42+
4143
$pg_hba_conf_defaults = $postgresql::params::pg_hba_conf_defaults,
4244

4345
$user = $postgresql::params::user,

manifests/server/config.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$datadir = $postgresql::server::datadir
2121
$logdir = $postgresql::server::logdir
2222
$service_name = $postgresql::server::service_name
23+
$log_line_prefix = $postgresql::server::log_line_prefix
2324

2425
if ($manage_pg_hba_conf == true) {
2526
# Prepare the main pg_hba file
@@ -115,6 +116,12 @@
115116
}
116117

117118
}
119+
# Allow timestamps in log by default
120+
if $log_line_prefix {
121+
postgresql::server::config_entry {'log_line_prefix':
122+
value => $log_line_prefix,
123+
}
124+
}
118125

119126
# RedHat-based systems hardcode some PG* variables in the init script, and need to be overriden
120127
# in /etc/sysconfig/pgsql/postgresql. Create a blank file so we can manage it with augeas later.

0 commit comments

Comments
 (0)