Bug 140429
Summary: | logwatch doesn't process yum logs correctly | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Theodore C. Belding <ted.belding> |
Component: | logwatch | Assignee: | Ivana Varekova <varekova> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3 | CC: | brian, gedetil, grdetil, holger, mattdm, paul, sitsofe |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-06-23 11:54:36 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Theodore C. Belding
2004-11-22 21:21:48 UTC
Created attachment 107244 [details]
/var/log/yum.log
Removing the line: *ApplyUSDate from /etc/log.d/conf/logfiles/yum.conf solves the problem. Though, I haven't yet found out what it does or tries to do. :) Ok, the above doesn't really solve it, as it always shows anything that's in your yum.log... The problem does seem to be with the *ApplyUSDate script; *ApplyStdDate doesn't work either. I modified /etc/log.d/scripts/services/yum to print out each line that it received from stdin, and if either *ApplyUSDate or *ApplyStdDate are used in /etc/log.d/conf/logfiles/yum.conf, /etc/log.d/scripts/services/yum gets no input. If neither script is used, /etc/log.d/scripts/services/yum gets the entire log file as input. I'm not sure why *ApplyStdDate doesn't work, since the dates seem to be in the same format as /var/log/messages (but without the host name). Okay, I've found and fixed the problems. yum logs are not in US date format but in syslog format without a host name. I modified ApplyStdDate to produce a script ApplyYumDate and modified /etc/log.d/conf/logfiles/yum.conf to use it. I also patched /etc/log.d/scripts/services/yum to remove dates in the syslog format "Nov 09 23:56:36". I'm attaching both applyyumdate and the patches. Created attachment 107340 [details]
/etc/log.d/scripts/shared/applyyumdate: logwatch date filter for yum logs
logwatch date filter for yum logs
Created attachment 107342 [details]
patch to /etc/log.d/scripts/services/yum
Created attachment 107343 [details]
patch to /etc/log.d/conf/logfiles/yum.conf
Created attachment 107849 [details]
/etc/log.d/scripts/logfiles/yum/applydate script
The applyyumdate script above will fail on single digit dates, as yum 2.1's log
file has a leading zero on these, and applyyumdate assumes a leading space.
Also, the standard way of adding a custom applydate script for a specific
logfile format is to put it in a directory for that log file name under the
/etc/log.d/scripts/logfiles directory, rather than in shared scripts. I've set
up my /etc/log.d/scripts/logfiles/yum/applydate script for yum to handle both
the old (pre-2.1) and new date formats. No change is needed to the
/etc/log.d/scripts/services/yum, but the "*ApplyUSDate" line in
/etc/log.d/conf/logfiles/yum.conf should be removed entirely.
The above changes seem to work fine for me. Thanks! The change mentioned in this bug work a charm for me too - can this change be pushed out in an update? I've put together a package based on the latest development SRPM and included Gilles Detillieux's changes mentioned in comment #9. Works fine for me (in older versions of Fedora too). It's available at: http://www.city-fan.org/ftp/contrib/sysutils/ I'll maintain a logwatch package there until such time as an official update comes out that fixes this problem. This issue is fixed in upstream versions >= 6 Fixed version in fc4. |