Red Hat Bugzilla – Bug 1177628
[RFE] pgsql logs are missing timestamps
Last modified: 2017-12-24 03:04:19 EST
Description of problem: $subject. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. engine-setup, accept default to automatically provision postgresql 2. Check files in /var/lib/pgsql/data/pg_log 3. Actual results: The log lines do not have timestamps, thus making it impossible to know when they were logged. Expected results: log lines do have timestamps Additional info: We need to edit postgresql.conf to have: log_line_prefix = '%t ' or some other variation. We might consider also trying to keep logs for some longer time (30 days?), have the date in the file name (and not weekday), other stuff?
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Let's make sure they are in UTC, btw.
(In reply to Yaniv Kaul from comment #2) > Let's make sure they are in UTC, btw. It's less flexible than strftime and friends. Sorry. Sample content (which is a result of restarting pg and doing engine-backup --mode=restore): ================================================================== 2017-11-27 17:23:25.104 IST LOG: database system was shut down at 2017-11-27 17:23:24 IST 2017-11-27 17:23:25.109 IST LOG: MultiXact member wraparound protections are now enabled 2017-11-27 17:23:25.114 IST LOG: database system is ready to accept connections 2017-11-27 17:23:25.114 IST LOG: autovacuum launcher started 2017-11-27 17:23:26.540 IST LOG: received fast shutdown request 2017-11-27 17:23:26.540 IST LOG: aborting any active transactions 2017-11-27 17:23:26.541 IST LOG: autovacuum launcher shutting down 2017-11-27 17:23:26.542 IST LOG: shutting down 2017-11-27 17:23:26.569 IST LOG: database system is shut down 2017-11-27 17:23:27.612 IST LOG: database system was shut down at 2017-11-27 17:23:26 IST 2017-11-27 17:23:27.617 IST LOG: MultiXact member wraparound protections are now enabled 2017-11-27 17:23:27.619 IST LOG: database system is ready to accept connections 2017-11-27 17:23:27.619 IST LOG: autovacuum launcher started 2017-11-27 17:23:29.149 IST LOG: received fast shutdown request 2017-11-27 17:23:29.149 IST LOG: aborting any active transactions 2017-11-27 17:23:29.149 IST LOG: autovacuum launcher shutting down 2017-11-27 17:23:29.151 IST LOG: shutting down 2017-11-27 17:23:29.169 IST LOG: database system is shut down 2017-11-27 17:23:30.231 IST LOG: database system was shut down at 2017-11-27 17:23:29 IST 2017-11-27 17:23:30.237 IST LOG: MultiXact member wraparound protections are now enabled 2017-11-27 17:23:30.239 IST LOG: database system is ready to accept connections 2017-11-27 17:23:30.239 IST LOG: autovacuum launcher started 2017-11-27 17:23:31.509 IST ERROR: must be owner of extension plpgsql 2017-11-27 17:23:31.510 IST STATEMENT: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; 2017-11-27 17:23:34.595 IST WARNING: column "user_role_title" has type "unknown" 2017-11-27 17:23:34.595 IST DETAIL: Proceeding with relation creation anyway. 2017-11-27 17:23:38.553 IST ERROR: must be owner of extension plpgsql 2017-11-27 17:23:38.553 IST STATEMENT: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; ================================================================== The three whitespace lines are original. The format is easy enough to parse, if we decide to do this one day, although sadly not identical to the format of other tools we use.
Seems while I can't output offset, I _can_ control the timezone.
Now it looks like this: 2017-11-28 07:05:57.539 UTC LOG: database system was shut down at 2017-11-28 07:05:56 UTC 2017-11-28 07:05:57.547 UTC LOG: MultiXact member wraparound protections are now enabled 2017-11-28 07:05:57.552 UTC LOG: database system is ready to accept connections 2017-11-28 07:05:57.552 UTC LOG: autovacuum launcher started 2017-11-28 07:05:58.994 UTC LOG: received fast shutdown request 2017-11-28 07:05:58.994 UTC LOG: aborting any active transactions 2017-11-28 07:05:58.994 UTC LOG: autovacuum launcher shutting down 2017-11-28 07:05:58.996 UTC LOG: shutting down 2017-11-28 07:05:59.015 UTC LOG: database system is shut down 2017-11-28 07:06:00.080 UTC LOG: database system was shut down at 2017-11-28 07:05:59 UTC 2017-11-28 07:06:00.085 UTC LOG: MultiXact member wraparound protections are now enabled 2017-11-28 07:06:00.087 UTC LOG: database system is ready to accept connections 2017-11-28 07:06:00.088 UTC LOG: autovacuum launcher started 2017-11-28 07:06:01.569 UTC LOG: received fast shutdown request 2017-11-28 07:06:01.569 UTC LOG: aborting any active transactions 2017-11-28 07:06:01.569 UTC LOG: autovacuum launcher shutting down 2017-11-28 07:06:01.571 UTC LOG: shutting down 2017-11-28 07:06:01.589 UTC LOG: database system is shut down 2017-11-28 07:06:02.637 UTC LOG: database system was shut down at 2017-11-28 07:06:01 UTC 2017-11-28 07:06:02.642 UTC LOG: MultiXact member wraparound protections are now enabled 2017-11-28 07:06:02.644 UTC LOG: database system is ready to accept connections 2017-11-28 07:06:02.644 UTC LOG: autovacuum launcher started 2017-11-28 07:06:03.925 UTC ERROR: must be owner of extension plpgsql 2017-11-28 07:06:03.926 UTC STATEMENT: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; 2017-11-28 07:06:07.053 UTC WARNING: column "user_role_title" has type "unknown" 2017-11-28 07:06:07.053 UTC DETAIL: Proceeding with relation creation anyway. 2017-11-28 07:06:10.726 UTC ERROR: must be owner of extension plpgsql 2017-11-28 07:06:10.726 UTC STATEMENT: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
logs are now in files named after month number and contains logs with UTC time verified in ovirt-engine-setup-4.2.0-0.6.el7.noarch
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.