Bug 1390674 - [RFE] Change log format to use UTC time zone
Summary: [RFE] Change log format to use UTC time zone
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: vdsm
Classification: oVirt
Component: RFEs
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: ovirt-4.2.0
: ---
Assignee: Yaniv Bronhaim
QA Contact: Aleksei Slaikovskii
URL:
Whiteboard:
Depends On: 1390867
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-01 16:19 UTC by Yaniv Bronhaim
Modified: 2019-04-28 13:45 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-15 08:46:31 UTC
oVirt Team: Infra
mperina: ovirt-4.2?
rule-engine: planning_ack?
rule-engine: devel_ack?
pstehlik: testing_ack+


Attachments (Terms of Use)

Description Yaniv Bronhaim 2016-11-01 16:19:37 UTC
Description of problem:
Currently VDSM and ovirt-engine uses the system time in each log prints. To align with common logging we need to replace the current format to use UTC.

Comment 1 Michal Skrivanek 2016-11-02 05:55:04 UTC
This needs to happen on both sides in the same release, not just vdsm

Comment 2 Nir Soffer 2016-11-02 06:54:18 UTC
We must have localtime timestamp in vdsm to debug system related issues.

This will not happen before /var/log/messages and /var/log/sanlock switch to UTC.

The only way to get UTC timestamps now is to set the system timezone to UTC, this
will automatically fix all logs on the system to use the same timezone.

Comment 3 Yaniv Kaul 2016-11-02 07:29:42 UTC
(In reply to Nir Soffer from comment #2)
> We must have localtime timestamp in vdsm to debug system related issues.
> 
> This will not happen before /var/log/messages and /var/log/sanlock switch to
> UTC.

journalctl can show in UTC (or not). If sanlock logs need to be fixed, we can file a bug on sanlock as well.

> 
> The only way to get UTC timestamps now is to set the system timezone to UTC,
> this
> will automatically fix all logs on the system to use the same timezone.

libvirt already uses UTC as well, I believe.

Comment 4 Nir Soffer 2016-11-02 07:40:50 UTC
Peter, do you know if syslog utc support (https://github.com/rsyslog/rsyslog/issues/730)
is available in Fedora/RHEL?

Comment 5 Nir Soffer 2016-11-02 07:43:41 UTC
(In reply to Yaniv Kaul from comment #3)
> (In reply to Nir Soffer from comment #2)
> > We must have localtime timestamp in vdsm to debug system related issues.
> > 
> > This will not happen before /var/log/messages and /var/log/sanlock switch to
> > UTC.
> 
> journalctl can show in UTC (or not).

Being able to provide UTC logs from journalctl is not the same as having UTC
logs in /var/log/messages. This increase the chance to get useable logs from
users.

> If sanlock logs need to be fixed, we
> can file a bug on sanlock as well.

I opened bug 1390867 for this.

Comment 6 Oved Ourfali 2016-11-02 08:19:01 UTC
(In reply to Michal Skrivanek from comment #1)
> This needs to happen on both sides in the same release, not just vdsm

There is already another RFE for the engine.

Comment 7 Michal Skrivanek 2016-11-04 06:11:51 UTC
(In reply to Oved Ourfali from comment #6)
> (In reply to Michal Skrivanek from comment #1)
> > This needs to happen on both sides in the same release, not just vdsm
> 
> There is already another RFE for the engine.

Interestingly it was not in the whine until today. Strange...

Comment 8 Oved Ourfali 2016-11-04 11:21:16 UTC
Well, I asked Martin to open it this week.... So apparently he did :-)

Comment 9 Nir Soffer 2016-11-05 21:09:31 UTC
Additional log files that must match vdsm timestamps:
- /var/log/glusterfs/
- /var/log/openvswitch/

Sahina, can we configure glusterfs to use UTC timestamps in the logs?

Comment 10 Sahina Bose 2016-11-07 15:28:15 UTC
(In reply to Nir Soffer from comment #9)
> Additional log files that must match vdsm timestamps:
> - /var/log/glusterfs/
> - /var/log/openvswitch/
> 
> Sahina, can we configure glusterfs to use UTC timestamps in the logs?

AFAIK, glusterfs already uses UTC timestamps in logs. Adding Krutika to confirm

Comment 11 Krutika Dhananjay 2016-11-08 08:50:26 UTC
(In reply to Sahina Bose from comment #10)
> (In reply to Nir Soffer from comment #9)
> > Additional log files that must match vdsm timestamps:
> > - /var/log/glusterfs/
> > - /var/log/openvswitch/
> > 
> > Sahina, can we configure glusterfs to use UTC timestamps in the logs?
> 
> AFAIK, glusterfs already uses UTC timestamps in logs. Adding Krutika to
> confirm

Yes, that is correct Sahina.

-Krutika

Comment 12 Peter Portante 2016-11-09 04:05:09 UTC
It is not clear to me that all timestamps emitted have to be in UTC, but they do have to include accurate timezone information.

For the last supported Fedora releases, I don't think rsyslog is installed by default, and so there is no /var/log/messages file.  If the user optionally installs rsyslog I believe they still get v7 (though hopefully v8 will make its way there soon if it has not already).

For v7, switching to use the RSYSLOG_FileFormat (sp?) template as the default instead of RSYSLOG_TraditionalFileFormat (sp?) should provide the proper timezone information in the logs.

Why are we not just requiring that the systems run in UTC?  There is no reason to run any system in another timezone besides UTC (we assert).

Comment 13 Martin Perina 2016-12-01 13:44:35 UTC
Moving to 4.2 as we will not be able to change logging time zone in 4.1

Comment 14 Yaniv Bronhaim 2017-01-16 12:34:17 UTC
the vdsm part is handled in bug #1408190

Comment 15 Martin Perina 2017-01-16 13:08:44 UTC
(In reply to Yaniv Bronhaim from comment #14)
> the vdsm part is handled in bug #1408190

This is not the same thing: BZ1408190 adds local time zone to log records, but this bug is about setting time zone of log records to UTC even though local system time zone is different.

Comment 16 Yaniv Kaul 2017-06-06 20:46:14 UTC
(In reply to Yaniv Kaul from comment #3)
> (In reply to Nir Soffer from comment #2)
> > We must have localtime timestamp in vdsm to debug system related issues.
> > 
> > This will not happen before /var/log/messages and /var/log/sanlock switch to
> > UTC.
> 
> journalctl can show in UTC (or not). If sanlock logs need to be fixed, we
> can file a bug on sanlock as well.

Sanlock can be configured to use UTC.


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