unit: Make sure individual unit maximum log level always takes priority
Currently LogLevelMax= can only be used to decrease the maximum log level for a unit but not to increase it. Let's make sure the latter works as well, so LogLevelMax=debug can be used to enable debug logging for specific units without enabling debug logging globally.
This commit is contained in:
+23
-16
@@ -3268,23 +3268,30 @@ StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZX
|
||||
<varlistentry>
|
||||
<term><varname>LogLevelMax=</varname></term>
|
||||
|
||||
<listitem><para>Configures filtering by log level of log messages generated by this unit. Takes a
|
||||
<command>syslog</command> log level, one of <option>emerg</option> (lowest log level, only highest priority
|
||||
messages), <option>alert</option>, <option>crit</option>, <option>err</option>, <option>warning</option>,
|
||||
<option>notice</option>, <option>info</option>, <option>debug</option> (highest log level, also lowest priority
|
||||
messages). See <citerefentry
|
||||
<listitem><para>Sets the maximum log level for log messages generated by this unit. Takes a
|
||||
<command>syslog</command> log level, one of <option>emerg</option> (lowest log level, only highest
|
||||
priority messages), <option>alert</option>, <option>crit</option>, <option>err</option>,
|
||||
<option>warning</option>, <option>notice</option>, <option>info</option>, <option>debug</option>
|
||||
(highest log level, also lowest priority messages). See <citerefentry
|
||||
project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry> for
|
||||
details. By default, no filtering is applied (i.e. the default maximum log level is <option>debug</option>). Use
|
||||
this option to configure the logging system to drop log messages of a specific service above the specified
|
||||
level. For example, set <varname>LogLevelMax=</varname><option>info</option> in order to turn off debug logging
|
||||
of a particularly chatty unit. Note that the configured level is applied to any log messages written by any
|
||||
of the processes belonging to this unit, as well as any log messages written by the system manager process
|
||||
(PID 1) in reference to this unit, sent via any supported logging protocol. The filtering is applied
|
||||
early in the logging pipeline, before any kind of further processing is done. Moreover, messages which pass
|
||||
through this filter successfully might still be dropped by filters applied at a later stage in the logging
|
||||
subsystem. For example, <varname>MaxLevelStore=</varname> configured in
|
||||
<citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> might
|
||||
prohibit messages of higher log levels to be stored on disk, even though the per-unit
|
||||
details. By default, the maximum log level is not overridden.</para>
|
||||
|
||||
<para>This option can be used to configure the logging system to drop log messages of a specific
|
||||
service above the specified level. For example, set
|
||||
<varname>LogLevelMax=</varname><option>info</option> in order to turn off debug logging of a
|
||||
particularly chatty unit. Alternatively, this option can be used to enable extra logging about a
|
||||
specific unit by the system or user manager processes without changing the global log level for the
|
||||
system or user manager processes by setting <varname>LogLevelMax=</varname><option>debug</option>.
|
||||
</para>
|
||||
|
||||
<para>Note that the configured level is applied to any log messages written by any of the processes
|
||||
belonging to this unit, as well as any log messages written by the system or user manager processes
|
||||
in reference to this unit, sent via any supported logging protocol. The override is applied early in
|
||||
the logging pipeline, before any kind of further processing is done. Moreover, messages which pass
|
||||
through this filter successfully might still be dropped by filters applied at a later stage in the
|
||||
logging subsystem. For example, <varname>MaxLevelStore=</varname> configured in
|
||||
<citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
might prohibit messages of higher log levels to be stored on disk, even though the per-unit
|
||||
<varname>LogLevelMax=</varname> permitted it to be processed.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v236"/></listitem>
|
||||
|
||||
Reference in New Issue
Block a user