mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
log: Log when kmsg is being ratelimited
Let's avoid confusing developers and users when log messages suddenly stop getting logged to kmsg because of ratelimiting by logging an additional message if we start ratelimiting log messages to kmsg.
This commit is contained in:
@@ -553,8 +553,12 @@ static int write_to_kmsg(
|
||||
if (kmsg_fd < 0)
|
||||
return 0;
|
||||
|
||||
if (ratelimit_kmsg && !ratelimit_below(&ratelimit))
|
||||
return 0;
|
||||
if (ratelimit_kmsg && !ratelimit_below(&ratelimit)) {
|
||||
if (ratelimit_num_dropped(&ratelimit) > 1)
|
||||
return 0;
|
||||
|
||||
buffer = "Too many messages being logged to kmsg, ignoring";
|
||||
}
|
||||
|
||||
xsprintf(header_priority, "<%i>", level);
|
||||
xsprintf(header_pid, "["PID_FMT"]: ", getpid_cached());
|
||||
|
||||
Reference in New Issue
Block a user