Skip to content

Commit 5bd27a1

Browse files
committed
man: describe various logging configuration variables
Fixes systemd#17484. This patch affects systemctl(1), as well as all man pages that include all of common-variables.xml, i.e. most of our command line tools.
1 parent 4ef3ca3 commit 5bd27a1

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

man/common-variables.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,79 @@
77
<title>Environment</title>
88

99
<variablelist class='environment-variables'>
10+
<varlistentry id='log-level'>
11+
<term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
12+
13+
<listitem><para>The maximum log level of emitted messages (messages with a higher log level, i.e. less
14+
important ones, will be suppressed). Either one of (in order of decreasing importance)
15+
<constant>emerg</constant>, <constant>alert</constant>, <constant>crit</constant>,
16+
<constant>err</constant>, <constant>warning</constant>, <constant>notice</constant>,
17+
<constant>info</constant>, <constant>debug</constant>, or an integer in the range 0…7. See
18+
<citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
19+
for more information.</para>
20+
</listitem>
21+
</varlistentry>
22+
23+
<varlistentry id='log-color'>
24+
<term><varname>$SYSTEMD_LOG_COLOR</varname></term>
25+
26+
<listitem><para>A boolean. If true, messages written to the tty will be colored according to
27+
priority.</para>
28+
29+
<para>This setting is only useful when messages are written directly to the terminal, because
30+
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
31+
other tools that display logs will color messages based on the log level on their own.</para>
32+
</listitem>
33+
</varlistentry>
34+
35+
<varlistentry id='log-time'>
36+
<term><varname>$SYSTEMD_LOG_TIME</varname></term>
37+
38+
<listitem><para>A boolean. If true, log messages will be prefixed with a timestamp.</para>
39+
40+
<para>This setting is only useful when messages are written directly to the terminal or a file, because
41+
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
42+
other tools that display logs will attach timestamps based on the entry metadata on their own.</para>
43+
</listitem>
44+
</varlistentry>
45+
46+
<varlistentry id='log-location'>
47+
<term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
48+
49+
<listitem><para>A boolean. If true, messages will be prefixed with a filename and line number
50+
in the source code where the message originates.</para>
51+
52+
<para>Note that the log location is often attached as metadata to journal entries anyway. Including it
53+
directly in the message text can nevertheless be convenient when debugging programs.</para>
54+
</listitem>
55+
</varlistentry>
56+
57+
<varlistentry id='log-tid'>
58+
<term><varname>$SYSTEMD_LOG_TID</varname></term>
59+
60+
<listitem><para>A boolean. If true, messages will be prefixed with the current numerical thread ID
61+
(TID).</para>
62+
63+
<para>Note that the this information is attached as metadata to journal entries anyway. Including it
64+
directly in the message text can nevertheless be convenient when debugging programs.</para>
65+
</listitem>
66+
</varlistentry>
67+
68+
<varlistentry id='log-target'>
69+
<term><varname>$SYSTEMD_LOG_TARGET</varname></term>
70+
71+
<listitem><para>The destination for log messages. One of <constant>console</constant> (log to the
72+
attached tty), <constant>console-prefixed</constant> (log to the attached tty but with prefixes
73+
encoding the log level and "facility", see <citerefentry
74+
project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
75+
<constant>kmsg</constant> (log to the kernel circular log buffer), <constant>journal</constant> (log to
76+
the journal), <constant>journal-or-kmsg</constant> (log to the journal if available, and to kmsg
77+
otherwise), <constant>auto</constant> (dermine the appropriate log target automatically, the default),
78+
<constant>null</constant> (disable log output).</para>
79+
<!-- <constant>syslog</constant>, <constant>syslog-or-kmsg</constant> are deprecated -->
80+
</listitem>
81+
</varlistentry>
82+
1083
<varlistentry id='pager'>
1184
<term><varname>$SYSTEMD_PAGER</varname></term>
1285

man/systemctl.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,11 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
24072407
</para></listitem>
24082408
</varlistentry>
24092409
</variablelist>
2410+
<xi:include href="common-variables.xml" xpointer="log-level"/>
2411+
<xi:include href="common-variables.xml" xpointer="log-color"/>
2412+
<xi:include href="common-variables.xml" xpointer="log-time"/>
2413+
<xi:include href="common-variables.xml" xpointer="log-location"/>
2414+
<xi:include href="common-variables.xml" xpointer="log-target"/>
24102415
<xi:include href="common-variables.xml" xpointer="pager"/>
24112416
<xi:include href="common-variables.xml" xpointer="less"/>
24122417
<xi:include href="common-variables.xml" xpointer="lesscharset"/>

0 commit comments

Comments
 (0)