| Summary: | Journald fails to forward to syslog message with level above its storing level | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Assen Totin <assen> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED CANTFIX | QA Contact: | qe-baseos-daemons |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | bblaskov, kwalker, msekleta, systemd-maint-list |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-11-07 12:51:50 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1420851, 1466365 | ||
|
Description
Assen Totin
2016-08-25 13:48:15 UTC
The same issue is observed when using systemd's native C API:
#include <systemd/sd-journal.h>
int main(int argc, char *argv[]) {
sd_journal_print(LOG_DEBUG, "Hello World");
return 0;
}
The problem here is that by default rsyslog does not listen on syslog.socket, but directly reads the journal files. This has the advantage that you will have logs from early boot in /var/log/messages. The disadvantage is that what is not in journal will not be in /var/log/messages. What you can do is to reconfigure rsyslog to read the redirected messages. I know almost nothing about rsyslog but I have tried this: 0) (setup journal to skip debug messages and rsyslog to accept them) 1) comment $ModLoad imjournal in rsyslog.conf 2) set $OmitLocalLogging off in rsyslog.conf 3) cp /usr/lib/systemd/system/rsyslog.service /etc/systemd/system/rsyslog.service 4) uncomment Requires=syslog.socket and Alias=syslog.service in /etc/systemd/system/rsyslog.service 5) systemctl daemon-reload; systemctl reenable rsyslog 6) systemctl restart rsyslog systemd-journald and now: [0 root@qeos-150 ~]# logger -p user.debug "yippee yay yeah" [0 root@qeos-150 ~]# tail -1 /var/log/messages Aug 30 04:13:50 qeos-150 root: yippee yay yeah Thanks, Lukas, I'm aware tat I can change the order in which rsyslogd and systemd-journald get the syslog messages, or even separate them. However, RHEL chose to configure the system by default the way it comes, with systemd-journald being the first in the chain. Also, RHEL chose to use imjournal rsyslogd moudle instead of $SystemLogSocketName, which on RHEL points to the non-existent /run/systemd/journal/syslog. The latter might be a suitable way of solving this? Well this is design issue that can't be fix. By default rsyslog is reading journal files, so the messages that are not in journal can't appear in rsyslog. |