Bug 65610

Summary: SyslogFacility ignored when SyslogLevelPrefix=true
Product: systemd Reporter: freedesktop.org
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.