Bug 197872 - yum forgets to log
Summary: yum forgets to log
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC6Blocker
TreeView+ depends on / blocked
 
Reported: 2006-07-06 20:00 UTC by Michal Jaegermann
Modified: 2014-01-21 22:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-10 23:40:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Get logging working for files and syslog (3.27 KB, patch)
2006-07-07 17:40 UTC, James Bowes
no flags Details | Diff
The cruft free patch (825 bytes, patch)
2006-07-07 18:28 UTC, James Bowes
no flags Details | Diff
Log to syslog and a file, and don't repeat entries. (2.48 KB, patch)
2006-07-10 15:24 UTC, James Bowes
no flags Details | Diff

Description Michal Jaegermann 2006-07-06 20:00:05 UTC
Description of problem:

After recent changes even if there is a line 'logfile=/var/log/yum.log'
nothing shows up in that logfile.  Neither 'man yum.conf' nor
a content of /etc/yum.conf suggests what could cause that and/or
how to revert it.  Transaction entries in /var/log/yum.log actually
provide a valuable record in tracking system modifications.

Version-Release number of selected component (if applicable):
yum-2.9.2-3

Comment 1 Jeremy Katz 2006-07-06 23:45:15 UTC
Indeed -- this is likely a side effect of replacing all the logging code. 
Adding jbowes to the cc list

Comment 2 James Bowes 2006-07-07 17:40:44 UTC
Created attachment 132073 [details]
Get logging working for files and syslog

Yeah, this is from the new logging. The attached patch gets things working,
however it displays 'Installed' messages twice, but 'Erased' messages only
once. I'm not sure what that is from.

Comment 3 James Bowes 2006-07-07 18:28:02 UTC
Created attachment 132079 [details]
The cruft free patch

Here is the proper patch. The previous one contained extra cruft.

Comment 4 Michal Jaegermann 2006-07-07 21:04:35 UTC
Indeed, after applying a patch from comment #3 yum starts
logging again.  Also I can observe as well that both for 'Installed'
_and_ 'Updated' entries yum now is "seeing double" although not for
'Erased'.

Comment 5 Michal Jaegermann 2006-07-07 21:27:44 UTC
Maybe this is a false track but a quick grep through .py from yum
shows that a string 'Erased' shows only in yum-cli/callback.py
file, even if in two different places, while 'Installed' and
'Updated' are there and also in yum-cli/output.py.  Try

  rpm -ql yum |grep '\.py$' |xargs grep -l "'Erased'"

and similar to see for yourself.

Comment 6 Michal Jaegermann 2006-07-08 20:42:37 UTC
Ok, a suggestion from comment #5 is a false track.  After slight string
modifications it is obvious that all log entries are printed from
yum-cli/callback.py.  OTOH updating a bigger number of packages at
once I see that there is a time difference in "doubled" log entries.
It ranges from roughly 30 seconds to over 2 minutes.  This suggests
that for every package a log entry is produced probably at
the installation start and the second time likely after a cleanup phase
was finished.

Comment 7 James Bowes 2006-07-10 15:22:03 UTC
(In reply to comment #6)
> Ok, a suggestion from comment #5 is a false track.  After slight string
> modifications it is obvious that all log entries are printed from
> yum-cli/callback.py.  OTOH updating a bigger number of packages at

Yeah. In fact, both install messages come from line 142. Removed messages come
from line 197.

> once I see that there is a time difference in "doubled" log entries.
> It ranges from roughly 30 seconds to over 2 minutes.  This suggests
> that for every package a log entry is produced probably at
> the installation start and the second time likely after a cleanup phase
> was finished.

Looks like it's actually the test transaction that prints out the first message,
and the actual transaction that does the second. I seem to have neglected to let
test transactions not produce any output...

Comment 8 James Bowes 2006-07-10 15:24:01 UTC
Created attachment 132182 [details]
Log to syslog and a file, and don't repeat entries.

This patch contains the code from previous patches, and turns on filtering
logging output on the RPM callback based on the output boolean flag passed in.

Comment 9 Michal Jaegermann 2006-07-10 17:33:30 UTC
I applied a patch from comment #8 to my copy of yum and AFAICT it logs
and it does not "stutter" for 'Installed', 'Updated' or 'Erased'.

Comment 10 Seth Vidal 2006-07-10 17:51:20 UTC
okay - I'll grab that patch and apply.

Comment 11 Jeremy Katz 2006-07-10 23:40:24 UTC
Seth applied this upstream and we should do a 2.9.3 "soon" which will have the fix. 


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