Bug 450949 - RFE: yum's syslog logging facility should be a yum.conf option
Summary: RFE: yum's syslog logging facility should be a yum.conf option
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-11 20:56 UTC by James Ralston
Modified: 2014-01-21 23:03 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-08-07 22:59:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description James Ralston 2008-06-11 20:56:55 UTC
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 21:59:11 UTC
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 22:01:57 UTC
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 04:05:13 UTC
triaged

Comment 4 James Antill 2008-08-07 22:59:01 UTC
 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.