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)
Created attachment 50204 [details] patch so time in log is time of action
applied, testing now
ended up appling a slightly different version of this, mainly to keep the log file format the same
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
should be fixed in version 2.7.62 or higher