Bug 197872 - yum forgets to log
yum forgets to log
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks: FC6Blocker
  Show dependency treegraph
 
Reported: 2006-07-06 16:00 EDT by Michal Jaegermann
Modified: 2014-01-21 17:54 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-10 19:40:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Michal Jaegermann 2006-07-06 16:00:05 EDT
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 19:45:15 EDT
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 13:40:44 EDT
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 14:28:02 EDT
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 17:04:35 EDT
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 17:27:44 EDT
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 16:42:37 EDT
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 11:22:03 EDT
(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 11:24:01 EDT
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 13:33:30 EDT
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 13:51:20 EDT
okay - I'll grab that patch and apply.
Comment 11 Jeremy Katz 2006-07-10 19:40:24 EDT
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.