]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/journald.conf.xml
travis: add more ASan options
[thirdparty/systemd.git] / man / journald.conf.xml
CommitLineData
b47ffcfd 1<?xml version='1.0'?> <!--*-nxml-*-->
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
b47ffcfd 5
a9edaeff 6<refentry id="journald.conf"
798d3a52
ZJS
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>journald.conf</title>
10 <productname>systemd</productname>
798d3a52
ZJS
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>journald.conf</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>journald.conf</refname>
20 <refname>journald.conf.d</refname>
21 <refpurpose>Journal service configuration files</refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
12b42c76
TG
25 <para><filename>/etc/systemd/journald.conf</filename></para>
26 <para><filename>/etc/systemd/journald.conf.d/*.conf</filename></para>
798d3a52 27 <para><filename>/run/systemd/journald.conf.d/*.conf</filename></para>
12b42c76 28 <para><filename>/usr/lib/systemd/journald.conf.d/*.conf</filename></para>
798d3a52
ZJS
29 </refsynopsisdiv>
30
31 <refsect1>
32 <title>Description</title>
33
0f943ae4
ZJS
34 <para>These files configure various parameters of the systemd journal service,
35 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
36 See
37 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry>
38 for a general description of the syntax.</para>
798d3a52
ZJS
39
40 </refsect1>
41
e93549ef 42 <xi:include href="standard-conf.xml" xpointer="main-conf" />
798d3a52
ZJS
43
44 <refsect1>
45 <title>Options</title>
46
47 <para>All options are configured in the
48 <literal>[Journal]</literal> section:</para>
49
d2acdcc6 50 <variablelist class='config-directives'>
798d3a52
ZJS
51
52 <varlistentry>
53 <term><varname>Storage=</varname></term>
54
55 <listitem><para>Controls where to store journal data. One of
56 <literal>volatile</literal>,
57 <literal>persistent</literal>,
58 <literal>auto</literal> and
59 <literal>none</literal>. If
60 <literal>volatile</literal>, journal
61 log data will be stored only in memory, i.e. below the
62 <filename>/run/log/journal</filename> hierarchy (which is
63 created if needed). If <literal>persistent</literal>, data
64 will be stored preferably on disk, i.e. below the
65 <filename>/var/log/journal</filename> hierarchy (which is
66 created if needed), with a fallback to
67 <filename>/run/log/journal</filename> (which is created if
68 needed), during early boot and if the disk is not writable.
69 <literal>auto</literal> is similar to
70 <literal>persistent</literal> but the directory
71 <filename>/var/log/journal</filename> is not created if
72 needed, so that its existence controls where log data goes.
73 <literal>none</literal> turns off all storage, all log data
74 received will be dropped. Forwarding to other targets, such as
589532d0 75 the console, the kernel log buffer, or a syslog socket will
798d3a52
ZJS
76 still work however. Defaults to
77 <literal>auto</literal>.</para></listitem>
78 </varlistentry>
79
80 <varlistentry>
81 <term><varname>Compress=</varname></term>
82
1b7cf0e5
AG
83 <listitem><para>Can take a boolean value. If enabled (the
84 default), data objects that shall be stored in the journal
85 and are larger than the default threshold of 512 bytes are
86 compressed before they are written to the file system. It
87 can also be set to a number of bytes to specify the
88 compression threshold directly. Suffixes like K, M, and G
89 can be used to specify larger units.</para></listitem>
798d3a52
ZJS
90 </varlistentry>
91
92 <varlistentry>
93 <term><varname>Seal=</varname></term>
94
95 <listitem><para>Takes a boolean value. If enabled (the
96 default), and a sealing key is available (as created by
97 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
98 <option>--setup-keys</option> command), Forward Secure Sealing
99 (FSS) for all persistent journal files is enabled. FSS is
100 based on <ulink
101 url="https://eprint.iacr.org/2013/397">Seekable Sequential Key
102 Generators</ulink> by G. A. Marson and B. Poettering
103 (doi:10.1007/978-3-642-40203-6_7) and may be used to protect
104 journal files from unnoticed alteration.</para></listitem>
105 </varlistentry>
106
107 <varlistentry>
108 <term><varname>SplitMode=</varname></term>
109
76153ad4
ZJS
110 <listitem><para>Controls whether to split up journal files per user, either <literal>uid</literal> or
111 <literal>none</literal>. Split journal files are primarily useful for access control: on UNIX/Linux access
112 control is managed per file, and the journal daemon will assign users read access to their journal files. If
113 <literal>uid</literal>, all regular users will each get their own journal files, and system users will log to
114 the system journal. If <literal>none</literal>, journal files are not split up by user and all messages are
115 instead stored in the single system journal. In this mode unprivileged users generally do not have access to
116 their own log data. Note that splitting up journal files by user is only available for journals stored
117 persistently. If journals are stored on volatile storage (see <varname>Storage=</varname> above), only a single
118 journal file is used. Defaults to <literal>uid</literal>.</para></listitem>
798d3a52
ZJS
119 </varlistentry>
120
121 <varlistentry>
f0367da7 122 <term><varname>RateLimitIntervalSec=</varname></term>
798d3a52
ZJS
123 <term><varname>RateLimitBurst=</varname></term>
124
125 <listitem><para>Configures the rate limiting that is applied
126 to all messages generated on the system. If, in the time
f0367da7 127 interval defined by <varname>RateLimitIntervalSec=</varname>,
798d3a52
ZJS
128 more messages than specified in
129 <varname>RateLimitBurst=</varname> are logged by a service,
130 all further messages within the interval are dropped until the
131 interval is over. A message about the number of dropped
132 messages is generated. This rate limiting is applied
133 per-service, so that two services which log do not interfere
3de8ff5a 134 with each other's limits. Defaults to 10000 messages in 30s.
798d3a52 135 The time specification for
f0367da7 136 <varname>RateLimitIntervalSec=</varname> may be specified in the
798d3a52
ZJS
137 following units: <literal>s</literal>, <literal>min</literal>,
138 <literal>h</literal>, <literal>ms</literal>,
139 <literal>us</literal>. To turn off any kind of rate limiting,
90fc172e
AZ
140 set either value to 0.</para>
141
142 <para>If a service provides rate limits for itself through
143 <varname>LogRateLimitIntervalSec=</varname> and/or <varname>LogRateLimitBurst=</varname>
144 in <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
145 those values will override the settings specified here.</para>
146 </listitem>
798d3a52
ZJS
147 </varlistentry>
148
149 <varlistentry>
150 <term><varname>SystemMaxUse=</varname></term>
151 <term><varname>SystemKeepFree=</varname></term>
152 <term><varname>SystemMaxFileSize=</varname></term>
8580d1f7 153 <term><varname>SystemMaxFiles=</varname></term>
798d3a52
ZJS
154 <term><varname>RuntimeMaxUse=</varname></term>
155 <term><varname>RuntimeKeepFree=</varname></term>
156 <term><varname>RuntimeMaxFileSize=</varname></term>
8580d1f7 157 <term><varname>RuntimeMaxFiles=</varname></term>
798d3a52
ZJS
158
159 <listitem><para>Enforce size limits on the journal files
160 stored. The options prefixed with <literal>System</literal>
161 apply to the journal files when stored on a persistent file
162 system, more specifically
163 <filename>/var/log/journal</filename>. The options prefixed
164 with <literal>Runtime</literal> apply to the journal files
165 when stored on a volatile in-memory file system, more
166 specifically <filename>/run/log/journal</filename>. The former
167 is used only when <filename>/var</filename> is mounted,
168 writable, and the directory
169 <filename>/var/log/journal</filename> exists. Otherwise, only
170 the latter applies. Note that this means that during early
171 boot and if the administrator disabled persistent logging,
172 only the latter options apply, while the former apply if
173 persistent logging is enabled and the system is fully booted
174 up. <command>journalctl</command> and
175 <command>systemd-journald</command> ignore all files with
176 names not ending with <literal>.journal</literal> or
177 <literal>.journal~</literal>, so only such files, located in
178 the appropriate directories, are taken into account when
8580d1f7 179 calculating current disk usage.</para>
798d3a52
ZJS
180
181 <para><varname>SystemMaxUse=</varname> and
182 <varname>RuntimeMaxUse=</varname> control how much disk space
a8eaaee7 183 the journal may use up at most.
798d3a52
ZJS
184 <varname>SystemKeepFree=</varname> and
185 <varname>RuntimeKeepFree=</varname> control how much disk
186 space systemd-journald shall leave free for other uses.
187 <command>systemd-journald</command> will respect both limits
188 and use the smaller of the two values.</para>
189
190 <para>The first pair defaults to 10% and the second to 15% of
32252660
LP
191 the size of the respective file system, but each value is
192 capped to 4G. If the file system is nearly full and either
193 <varname>SystemKeepFree=</varname> or
8580d1f7
LP
194 <varname>RuntimeKeepFree=</varname> are violated when
195 systemd-journald is started, the limit will be raised to the
798d3a52
ZJS
196 percentage that is actually free. This means that if there was
197 enough free space before and journal files were created, and
198 subsequently something else causes the file system to fill up,
199 journald will stop using more space, but it will not be
a8eaaee7 200 removing existing files to reduce the footprint again,
1a0d353b
MK
201 either. Also note that only archived files are deleted to reduce the
202 space occupied by journal files. This means that, in effect, there might
203 still be more space used than <varname>SystemMaxUse=</varname> or
204 <varname>RuntimeMaxUse=</varname> limit after a vacuuming operation is
205 complete.</para>
798d3a52 206
589532d0
ZJS
207 <para><varname>SystemMaxFileSize=</varname> and
208 <varname>RuntimeMaxFileSize=</varname> control how large
a8eaaee7 209 individual journal files may grow at most. This influences
589532d0
ZJS
210 the granularity in which disk space is made available through
211 rotation, i.e. deletion of historic data. Defaults to one
212 eighth of the values configured with
798d3a52 213 <varname>SystemMaxUse=</varname> and
589532d0 214 <varname>RuntimeMaxUse=</varname>, so that usually seven
8580d1f7 215 rotated journal files are kept as history.</para>
b6872d3a
JS
216
217 <para>Specify values in bytes or use K, M, G, T, P, E as
1eecafb8 218 units for the specified sizes (equal to 1024, 1024², … bytes).
b6872d3a
JS
219 Note that size limits are enforced synchronously when journal
220 files are extended, and no explicit rotation step triggered by
221 time is needed.</para>
8580d1f7
LP
222
223 <para><varname>SystemMaxFiles=</varname> and
224 <varname>RuntimeMaxFiles=</varname> control how many
a8eaaee7 225 individual journal files to keep at most. Note that only
8580d1f7
LP
226 archived files are deleted to reduce the number of files until
227 this limit is reached; active files will stay around. This
b938cb90 228 means that, in effect, there might still be more journal files
8580d1f7
LP
229 around in total than this limit after a vacuuming operation is
230 complete. This setting defaults to 100.</para></listitem>
798d3a52
ZJS
231 </varlistentry>
232
233 <varlistentry>
234 <term><varname>MaxFileSec=</varname></term>
235
236 <listitem><para>The maximum time to store entries in a single
237 journal file before rotating to the next one. Normally,
238 time-based rotation should not be required as size-based
239 rotation with options such as
240 <varname>SystemMaxFileSize=</varname> should be sufficient to
241 ensure that journal files do not grow without bounds. However,
242 to ensure that not too much data is lost at once when old
243 journal files are deleted, it might make sense to change this
244 value from the default of one month. Set to 0 to turn off this
245 feature. This setting takes time values which may be suffixed
246 with the units <literal>year</literal>,
247 <literal>month</literal>, <literal>week</literal>,
248 <literal>day</literal>, <literal>h</literal> or
249 <literal>m</literal> to override the default time unit of
250 seconds.</para></listitem>
251 </varlistentry>
252
253 <varlistentry>
254 <term><varname>MaxRetentionSec=</varname></term>
255
256 <listitem><para>The maximum time to store journal entries.
257 This controls whether journal files containing entries older
ad7c65e6 258 than the specified time span are deleted. Normally, time-based
798d3a52
ZJS
259 deletion of old journal files should not be required as
260 size-based deletion with options such as
261 <varname>SystemMaxUse=</varname> should be sufficient to
262 ensure that journal files do not grow without bounds. However,
263 to enforce data retention policies, it might make sense to
264 change this value from the default of 0 (which turns off this
265 feature). This setting also takes time values which may be
266 suffixed with the units <literal>year</literal>,
267 <literal>month</literal>, <literal>week</literal>,
268 <literal>day</literal>, <literal>h</literal> or <literal>
269 m</literal> to override the default time unit of
270 seconds.</para></listitem>
271 </varlistentry>
272
798d3a52
ZJS
273 <varlistentry>
274 <term><varname>SyncIntervalSec=</varname></term>
275
276 <listitem><para>The timeout before synchronizing journal files
277 to disk. After syncing, journal files are placed in the
278 OFFLINE state. Note that syncing is unconditionally done
279 immediately after a log message of priority CRIT, ALERT or
280 EMERG has been logged. This setting hence applies only to
281 messages of the levels ERR, WARNING, NOTICE, INFO, DEBUG. The
282 default timeout is 5 minutes. </para></listitem>
283 </varlistentry>
284
285 <varlistentry>
286 <term><varname>ForwardToSyslog=</varname></term>
287 <term><varname>ForwardToKMsg=</varname></term>
288 <term><varname>ForwardToConsole=</varname></term>
289 <term><varname>ForwardToWall=</varname></term>
290
5707ecf3
ZJS
291 <listitem><para>Control whether log messages received by the journal daemon shall
292 be forwarded to a traditional syslog daemon, to the kernel log buffer (kmsg), to
293 the system console, or sent as wall messages to all logged-in users. These
294 options take boolean arguments. If forwarding to syslog is enabled but nothing
295 reads messages from the socket, forwarding to syslog has no effect. By default,
296 only forwarding to wall is enabled. These settings may be overridden at boot time
297 with the kernel command line options
298 <literal>systemd.journald.forward_to_syslog</literal>,
299 <literal>systemd.journald.forward_to_kmsg</literal>,
300 <literal>systemd.journald.forward_to_console</literal>, and
301 <literal>systemd.journald.forward_to_wall</literal>. If the option name is
302 specified without <literal>=</literal> and the following argument, true is
303 assumed. Otherwise, the argument is parsed as a boolean. When forwarding to the
304 console, the TTY to log to can be changed with <varname>TTYPath=</varname>,
305 described below.</para></listitem>
798d3a52
ZJS
306 </varlistentry>
307
308 <varlistentry>
309 <term><varname>MaxLevelStore=</varname></term>
310 <term><varname>MaxLevelSyslog=</varname></term>
311 <term><varname>MaxLevelKMsg=</varname></term>
312 <term><varname>MaxLevelConsole=</varname></term>
313 <term><varname>MaxLevelWall=</varname></term>
314
315 <listitem><para>Controls the maximum log level of messages
316 that are stored on disk, forwarded to syslog, kmsg, the
317 console or wall (if that is enabled, see above). As argument,
318 takes one of
319 <literal>emerg</literal>,
320 <literal>alert</literal>,
321 <literal>crit</literal>,
322 <literal>err</literal>,
323 <literal>warning</literal>,
324 <literal>notice</literal>,
325 <literal>info</literal>,
326 <literal>debug</literal>,
b938cb90 327 or integer values in the range of 0–7 (corresponding to the
798d3a52
ZJS
328 same levels). Messages equal or below the log level specified
329 are stored/forwarded, messages above are dropped. Defaults to
330 <literal>debug</literal> for <varname>MaxLevelStore=</varname>
331 and <varname>MaxLevelSyslog=</varname>, to ensure that the all
332 messages are written to disk and forwarded to syslog. Defaults
333 to
334 <literal>notice</literal> for <varname>MaxLevelKMsg=</varname>,
335 <literal>info</literal> for <varname>MaxLevelConsole=</varname>,
336 and <literal>emerg</literal> for
863a5610
UTL
337 <varname>MaxLevelWall=</varname>. These settings may be
338 overridden at boot time with the kernel command line options
339 <literal>systemd.journald.max_level_store=</literal>,
340 <literal>systemd.journald.max_level_syslog=</literal>,
341 <literal>systemd.journald.max_level_kmsg=</literal>,
342 <literal>systemd.journald.max_level_console=</literal>,
343 <literal>systemd.journald.max_level_wall=</literal>.</para>
344 </listitem>
798d3a52
ZJS
345 </varlistentry>
346
b2392ff3
SS
347 <varlistentry>
348 <term><varname>ReadKMsg=</varname></term>
349
350 <listitem><para>Takes a boolean value. If enabled (the
351 default), journal reads <filename>/dev/kmsg</filename>
352 messages generated by the kernel.</para></listitem>
353 </varlistentry>
354
798d3a52
ZJS
355 <varlistentry>
356 <term><varname>TTYPath=</varname></term>
357
358 <listitem><para>Change the console TTY to use if
359 <varname>ForwardToConsole=yes</varname> is used. Defaults to
360 <filename>/dev/console</filename>.</para></listitem>
361 </varlistentry>
362
ec20fe5f
LP
363 <varlistentry>
364 <term><varname>LineMax=</varname></term>
365
366 <listitem><para>The maximum line length to permit when converting stream logs into record logs. When a systemd
367 unit's standard output/error are connected to the journal via a stream socket, the data read is split into
368 individual log records at newline (<literal>\n</literal>, ASCII 10) and NUL characters. If no such delimiter is
dcfaecc7 369 read for the specified number of bytes a hard log record boundary is artificially inserted, breaking up overly
ec20fe5f
LP
370 long lines into multiple log records. Selecting overly large values increases the possible memory usage of the
371 Journal daemon for each stream client, as in the worst case the journal daemon needs to buffer the specified
372 number of bytes in memory before it can flush a new log record to disk. Also note that permitting overly large
373 line maximum line lengths affects compatibility with traditional log protocols as log records might not fit
374 anymore into a single <constant>AF_UNIX</constant> or <constant>AF_INET</constant> datagram. Takes a size in
375 bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes,
376 Gigabytes, or Terabytes (with the base 1024), respectively. Defaults to 48K, which is relatively large but
377 still small enough so that log records likely fit into network datagrams along with extra room for
378 metadata. Note that values below 79 are not accepted and will be bumped to 79.</para></listitem>
379 </varlistentry>
380
798d3a52
ZJS
381 </variablelist>
382
383 </refsect1>
384
589532d0
ZJS
385 <refsect1>
386 <title>Forwarding to traditional syslog daemons</title>
387
388 <para>
7703bd4d 389 Journal events can be transferred to a different logging daemon
a8eaaee7 390 in two different ways. With the first method, messages are
589532d0
ZJS
391 immediately forwarded to a socket
392 (<filename>/run/systemd/journal/syslog</filename>), where the
393 traditional syslog daemon can read them. This method is
a8eaaee7 394 controlled by the <varname>ForwardToSyslog=</varname> option. With a
589532d0
ZJS
395 second method, a syslog daemon behaves like a normal journal
396 client, and reads messages from the journal files, similarly to
397 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
a8eaaee7 398 With this, messages do not have to be read immediately,
589532d0
ZJS
399 which allows a logging daemon which is only started late in boot
400 to access all messages since the start of the system. In
401 addition, full structured meta-data is available to it. This
402 method of course is available only if the messages are stored in
7703bd4d 403 a journal file at all. So it will not work if
589532d0 404 <varname>Storage=none</varname> is set. It should be noted that
7703bd4d 405 usually the <emphasis>second</emphasis> method is used by syslog
589532d0
ZJS
406 daemons, so the <varname>Storage=</varname> option, and not the
407 <varname>ForwardToSyslog=</varname> option, is relevant for them.
408 </para>
409 </refsect1>
410
798d3a52
ZJS
411 <refsect1>
412 <title>See Also</title>
413 <para>
414 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
415 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
416 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
417 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
418 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
419 </para>
420 </refsect1>
b47ffcfd
LP
421
422</refentry>