Bug 1758066
| Summary: | daemon_logv doesn't filter out logs below configured level | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Renaud Métrich <rmetrich> |
| Component: | libdaemon | Assignee: | Lennart Poettering <lpoetter> |
| Status: | CLOSED WONTFIX | QA Contact: | qe-baseos-daemons |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.7 | CC: | rik.theys |
| 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: | 2020-11-11 21:51:57 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: | |
| Embargoed: | |||
Red Hat Enterprise Linux 7 shipped it's final minor release on September 29th, 2020. 7.9 was the last minor releases scheduled for RHEL 7. From intial triage it does not appear the remaining Bugzillas meet the inclusion criteria for Maintenance Phase 2 and will now be closed. From the RHEL life cycle page: https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase "During Maintenance Support 2 Phase for Red Hat Enterprise Linux version 7,Red Hat defined Critical and Important impact Security Advisories (RHSAs) and selected (at Red Hat discretion) Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available." If this BZ was closed in error and meets the above criteria please re-open it flag for 7.9.z, provide suitable business and technical justifications, and follow the process for Accelerated Fixes: https://source.redhat.com/groups/public/pnt-cxno/pnt_customer_experience_and_operations_wiki/support_delivery_accelerated_fix_release_handbook Feature Requests can re-opened and moved to RHEL 8 if the desired functionality is not already present in the product. Please reach out to the applicable Product Experience Engineer[0] if you have any questions or concerns. [0] https://bugzilla.redhat.com/page.cgi?id=agile_component_mapping.html&product=Red+Hat+Enterprise+Linux+7 |
Description of problem: The daemon_logv() function, when used with syslog facility, always sends the log to syslog, whatever the priority: dlog.c: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 35 static int daemon_verbosity_level = LOG_INFO; 46 void daemon_logv(int prio, const char* template, va_list arglist) { 47 int saved_errno; 48 49 saved_errno = errno; 50 51 if (daemon_log_use & DAEMON_LOG_SYSLOG) { 52 openlog(daemon_log_ident ? daemon_log_ident : "UNKNOWN", LOG_PID, LOG_DAEMON); 53 vsyslog(prio | LOG_DAEMON, template, arglist); 54 } 55 56 if (prio > daemon_verbosity_level) 57 goto end_daemon_logv; -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- The condition on line 56 should be moved prior to line 51. This results in NetworkManager's teamd daemon, a daemonlog client, to send Debug messages every second even though daemon_verbosity_level is set to LOG_INFO. Note that this may be expected behaviour, from dlog.h: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 94 /** Setter for the verbosity level of standard output. 95 * 96 * @param verbosity_prio Minimum priority level for messages to output 97 * on standard output/error 98 * 99 * Allows to decide which messages to output on standard output/error 100 * streams. All messages are logged to syslog and this setting does 101 * not influence that. 102 * 103 * The default value is LOG_WARNING. 104 * 105 * @since 0.14 106 * @see DAEMON_SET_VERBOSITY_AVAILABLE -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- If so, then filtering should be made on the client side, which looks redundant to me. In any case, even if it's expected behaviour the line 103 should be changed because default value is not LOG_WARNING, but LOG_INFO (see dlog.c line 35 above). Version-Release number of selected component (if applicable): libdaemon-0.14-7.el7.x86_64 How reproducible: Always