Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1177628 - [RFE] pgsql logs are missing timestamps
[RFE] pgsql logs are missing timestamps
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: Setup.EngineCommon (Show other bugs)
3.5.0
Unspecified Unspecified
medium Severity medium (vote)
: ovirt-4.2.0
: 4.2.0
Assigned To: Yedidyah Bar David
Lucie Leistnerova
: FutureFeature, Improvement
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-29 09:03 EST by Yedidyah Bar David
Modified: 2017-12-24 03:04 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
PostgreSQL is configured to save log entries for a year and to include timestamps.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-20 05:44:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.2+
rule-engine: exception+
lsvaty: testing_plan_complete-
ylavi: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 84683 master MERGED packaging: setup: Configure postgresql logs 2017-11-27 10:59 EST
oVirt gerrit 84773 master MERGED packaging: setup: Use UTC in postgresql logs timestamps 2017-11-28 02:55 EST

  None (edit)
Description Yedidyah Bar David 2014-12-29 09:03:20 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?
Comment 1 Red Hat Bugzilla Rules Engine 2015-10-19 06:59:36 EDT
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.
Comment 2 Yaniv Kaul 2016-11-21 05:09:20 EST
Let's make sure they are in UTC, btw.
Comment 3 Yedidyah Bar David 2017-11-28 01:34:38 EST
(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.
Comment 4 Yedidyah Bar David 2017-11-28 01:38:48 EST
Seems while I can't output offset, I _can_ control the timezone.
Comment 5 Red Hat Bugzilla Rules Engine 2017-11-28 01:38:57 EST
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.
Comment 6 Yedidyah Bar David 2017-11-28 05:12:53 EST
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';
Comment 7 Lucie Leistnerova 2017-12-07 07:34:06 EST
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
Comment 8 Sandro Bonazzola 2017-12-20 05:44:51 EST
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.

Note You need to log in before you can comment on or make changes to this bug.