journald: systemd.journald.max_level_* kernel command line options (#4427)
authorUmut Tezduyar Lindskog <umut@tezduyar.com>
Fri, 21 Oct 2016 23:40:55 +0000 (01:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Oct 2016 23:40:55 +0000 (19:40 -0400)
The log forward levels can be configured through kernel command line.

man/journald.conf.xml
src/journal/journald-server.c

index a9562c1..df2e224 100644 (file)
         <literal>notice</literal> for <varname>MaxLevelKMsg=</varname>,
         <literal>info</literal> for <varname>MaxLevelConsole=</varname>,
         and <literal>emerg</literal> for
-        <varname>MaxLevelWall=</varname>.</para></listitem>
+        <varname>MaxLevelWall=</varname>. These settings may be
+        overridden at boot time with the kernel command line options
+        <literal>systemd.journald.max_level_store=</literal>,
+        <literal>systemd.journald.max_level_syslog=</literal>,
+        <literal>systemd.journald.max_level_kmsg=</literal>,
+        <literal>systemd.journald.max_level_console=</literal>,
+        <literal>systemd.journald.max_level_wall=</literal>.</para>
+        </listitem>
       </varlistentry>
 
       <varlistentry>
index 5ea65e2..92c623d 100644 (file)
@@ -71,6 +71,7 @@
 #include "string-table.h"
 #include "string-util.h"
 #include "user-util.h"
+#include "syslog-util.h"
 
 #define USER_JOURNALS_MAX 1024
 
@@ -1573,6 +1574,36 @@ static int server_parse_proc_cmdline(Server *s) {
                                 log_warning("Failed to parse forward to wall switch %s. Ignoring.", word + 33);
                         else
                                 s->forward_to_wall = r;
+                } else if (startswith(word, "systemd.journald.max_level_console=")) {
+                        r = log_level_from_string(word + 35);
+                        if (r < 0)
+                                log_warning("Failed to parse max level console value %s. Ignoring.", word + 35);
+                        else
+                                s->max_level_console = r;
+                } else if (startswith(word, "systemd.journald.max_level_store=")) {
+                        r = log_level_from_string(word + 33);
+                        if (r < 0)
+                                log_warning("Failed to parse max level store value %s. Ignoring.", word + 33);
+                        else
+                                s->max_level_store = r;
+                } else if (startswith(word, "systemd.journald.max_level_syslog=")) {
+                        r = log_level_from_string(word + 34);
+                        if (r < 0)
+                                log_warning("Failed to parse max level syslog value %s. Ignoring.", word + 34);
+                        else
+                                s->max_level_syslog = r;
+                } else if (startswith(word, "systemd.journald.max_level_kmsg=")) {
+                        r = log_level_from_string(word + 32);
+                        if (r < 0)
+                                log_warning("Failed to parse max level kmsg value %s. Ignoring.", word + 32);
+                        else
+                                s->max_level_kmsg = r;
+                } else if (startswith(word, "systemd.journald.max_level_wall=")) {
+                        r = log_level_from_string(word + 32);
+                        if (r < 0)
+                                log_warning("Failed to parse max level wall value %s. Ignoring.", word + 32);
+                        else
+                                s->max_level_wall = r;
                 } else if (startswith(word, "systemd.journald"))
                         log_warning("Invalid systemd.journald parameter. Ignoring.");
         }