journal: log filtering options support in PID1
Define new unit parameter (LogFilterPatterns) to filter logs processed by journald. This option is used to store a regular expression which is carried from PID1 to systemd-journald through a cgroup xattrs: `user.journald_log_filter_patterns`.
This commit is contained in:
@@ -1218,6 +1218,16 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (streq(field, "LogFilterPatterns")) {
|
||||
r = sd_bus_message_append(m, "(sv)", "LogFilterPatterns", "a(bs)", 1,
|
||||
eq[0] != '~',
|
||||
eq[0] != '~' ? eq : eq + 1);
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (STR_IN_SET(field, "StandardInput",
|
||||
"StandardOutput",
|
||||
"StandardError")) {
|
||||
|
||||
Reference in New Issue
Block a user