Bug 65610 - SyslogFacility ignored when SyslogLevelPrefix=true
Summary: SyslogFacility ignored when SyslogLevelPrefix=true
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-10 13:35 UTC by freedesktop.org
Modified: 2013-06-10 22:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description freedesktop.org 2013-06-10 13:35:44 UTC
Messages of services configured with SyslogLevelPrefix=true are always logged as facility "user", no matter what SyslogFacility is set to.

Example:

---------
[Unit]
Description=Facility Test

[Install]

[Service]
ExecStart=/bin/sh -c 'while /bin/true; do echo "<4>Hello World"; sleep 3; done'
KillMode=process

StandardInput=null
StandardOutput=syslog
StandardError=inherit

SyslogFacility=mail
SyslogIdentifier=facility-test
SyslogLevel=notice
SyslogLevelPrefix=true
----------

These messages end up in /var/log/messages, not /var/log/mail. An strace on the syslog daemon shows that it's not a syslog configuration problem:

[pid 20592] recvfrom(3, "<12>Jun 10 15:27:46 facility-tes"..., 8192, 0, {sa_family=AF_FILE, sun_path="/dev/log"}, [11]) = 53

I. e. syslog receives these as 12=1*8+4, which is facility "user" and level 4.

(Discovered on openSUSE-12.3 with systemd-13.25.1)
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-06-10 22:11:26 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=49998b3. Please test.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.