Bug 450949 - RFE: yum's syslog logging facility should be a yum.conf option
RFE: yum's syslog logging facility should be a yum.conf option
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-11 16:56 EDT by James Ralston
Modified: 2014-01-21 18:03 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-07 18:59:01 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)

  None (edit)
Description James Ralston 2008-06-11 16:56:55 EDT
In config.py, the facility that yum uses when it syslogs messages is hardcoded
to LOG_DAEMON.  This should be configurable via /etc/yum.conf (with LOG_DAEMON
being the default), so that the sysadmin has the ability to direct yum's log
messages to a separate file.

Yes, all of yum's log messages are already in a separate file, in
/var/log/yum.log.  But /var/log/yum.log is written directly by yum, not by
rsyslog, so it's not possible to use rsyslog's advanced
formatting/classification features.  E.g.:

$ cat /etc/rsyslog.d/yum.conf
$ActionFileDefaultTemplate RSYSLOG_FileFormat
$template YumLogFile,"/var/log/%$YEAR%/%$MONTH%/yum.log.%$YEAR%-%$MONTH%-%$DAY%"
local0.* ?YumLogFile

$ tail /var/log/2008/11/yum.log.2008-06-11
[...]
2008-06-11T16:12:14.043954-04:00 localhost yum: Updated:
3:ypbind-1.20.4-6.fc9.x86_64
2008-06-11T16:12:14.142591-04:00 localhost yum: Updated:
gvfs-fuse-0.2.4-3.fc9.x86_64
2008-06-11T16:12:15.394277-04:00 localhost yum: Updated: rpmlint-0.83-1.fc9.noarch

I could give you a simple patch to make the facility configurable, but
validating that the user has set it to a valid facility is probably beyond my
meager python skills...
Comment 1 seth vidal 2008-06-11 17:59:11 EDT
Rsyslog can filter on the program name that's doing the logging, not just by
facility - is it really necessary to make the logging facility configurable with
this in mind?
Comment 2 James Ralston 2008-06-12 18:01:57 EDT
Yes, rsyslog can filter on the program name, but doing so is going to take a
performance hit.  (For a lightly-loaded server, the hit should be negligible,
but for a very busy server, or a centralized logging server, the hit might be
non-trivial.)

The facility is the easiest and most efficient way to filter the messages. 
Adding the ability to customize the facility yum syslogs using looks to be
trivial, which is why I suggested it.

Other than a general opposition to feature creep, do you have a particular
concern over adding this feature?
Comment 3 John Poelstra 2008-07-04 00:05:13 EDT
triaged
Comment 4 James Antill 2008-08-07 18:59:01 EDT
 Ok, the summary/description is very wrong here:

yum.conf already has:

    syslog_ident = Option()
    syslog_facility = Option('LOG_DAEMON')

...however yum never calls syslog on it's own, so it gets the default (LOG_USER and no ident). yum-updatesd uses the syslog config.
 I've tied the config. to the syslog.openlog() inside yum upstream.

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