Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1177628

Summary: [RFE] pgsql logs are missing timestamps
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineCommonAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.0CC: bazulay, bugs, didi, lsurette, lsvaty, rbalakri, Rhev-m-bugs, sbonazzo, srevivo, ykaul, ylavi
Target Milestone: ovirt-4.2.0Keywords: FutureFeature, Improvement
Target Release: 4.2.0Flags: rule-engine: ovirt-4.2+
rule-engine: exception+
lsvaty: testing_plan_complete-
ylavi: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 10:44:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yedidyah Bar David 2014-12-29 14:03:20 UTC
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 10:59:36 UTC
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 10:09:20 UTC
Let's make sure they are in UTC, btw.

Comment 3 Yedidyah Bar David 2017-11-28 06:34:38 UTC
(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 06:38:48 UTC
Seems while I can't output offset, I _can_ control the timezone.

Comment 5 Red Hat Bugzilla Rules Engine 2017-11-28 06:38:57 UTC
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 10:12:53 UTC
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 12:34:06 UTC
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 10:44:51 UTC
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.