Bug 61888 - misleading log times in up2date's log
Summary: misleading log times in up2date's log
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: up2date
Version: 7.2
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Adrian Likins
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-25 17:53 UTC by James Manning
Modified: 2015-01-07 23:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-03-25 23:14:31 UTC
Embargoed:


Attachments (Terms of Use)
patch so time in log is time of action (686 bytes, patch)
2002-03-25 17:54 UTC, James Manning
no flags Details | Diff

Description James Manning 2002-03-25 17:53:03 UTC
Basically, the log_info that contains the time for log entries is set when the Log
class instance log is first created - this results in logfile entries that always
have the same time setting, no matter when the action actually happened.

As I'm writing this bugzilla entry, for example, the 2 lines that rhn_check's
call to up2date just wrote to my /var/spool/up2date say it's 20 minutes ago:

[Mon Mar 25 12:18:37 2002] up2date deleting /var/spool/up2date/cyrus-sasl-1.5.24-22.7.i386.hdr
[Mon Mar 25 12:18:37 2002] up2date deleting /var/spool/up2date/cyrus-sasl-1.5.24-22.7.i386.rpm
[root@porivoapp02 log]# date
Mon Mar 25 12:38:15 EST 2002

if "time up2date got started" needs to be preserved, we can just have a line get spit
to the log when up2date gets started.  Since it's when we assign the time now, doing
that log line in Log's __init__ seems appropriate.

I'll attach a patch that does this

So... basically

BEFORE
----------
[Mon Mar 25 12:19:07 2002] up2date Opening rpmdb in /var/lib/rpm/ with option 0
[Mon Mar 25 12:19:07 2002] up2date updating login info

AFTER
--------
[up2date] [Mon Mar 25 12:47:20 2002] Opening rpmdb in /var/lib/rpm/ with option 0
[up2date] [Mon Mar 25 12:47:21 2002] updating login info

(the time reflects the actual time that it happened instead of when up2date started)

Comment 1 James Manning 2002-03-25 17:54:02 UTC
Created attachment 50204 [details]
patch so time in log is time of action

Comment 2 Adrian Likins 2002-03-25 20:47:26 UTC
applied, testing now

Comment 3 Adrian Likins 2002-03-25 21:14:35 UTC
ended up appling a slightly different version of this, mainly
to keep the log file format the same

Comment 4 James Manning 2002-03-25 21:20:30 UTC
sweet!  I didn't like the output mine was producing, but I didn't wanna change the
actual code too much in semantics (fixed string at start).  coolio


Comment 5 Adrian Likins 2002-03-25 23:14:27 UTC
should be fixed in version 2.7.62 or higher


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