1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="journald.conf"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
9 <title>journald.conf</title>
10 <productname>systemd</productname>
14 <refentrytitle>journald.conf</refentrytitle>
15 <manvolnum>5</manvolnum>
19 <refname>journald.conf</refname>
20 <refname>journald.conf.d</refname>
21 <refname>journald@.conf</refname>
22 <refpurpose>Journal service configuration files</refpurpose>
26 <para><filename>/etc/systemd/journald.conf</filename></para>
27 <para><filename>/etc/systemd/journald.conf.d/*.conf</filename></para>
28 <para><filename>/run/systemd/journald.conf.d/*.conf</filename></para>
29 <para><filename>/usr/lib/systemd/journald.conf.d/*.conf</filename></para>
30 <para><filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf</filename></para>
31 <para><filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
32 <para><filename>/run/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
33 <para><filename>/usr/lib/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
37 <title>Description</title>
39 <para>These files configure various parameters of the systemd journal service,
40 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
42 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry>
43 for a general description of the syntax.</para>
45 <para>The <command>systemd-journald</command> instance managing the default namespace is configured by
46 <filename>/etc/systemd/journald.conf</filename> and associated drop-ins. Instances managing other
47 namespaces read <filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf</filename>
48 and associated drop-ins with the namespace identifier filled in. This allows each namespace to carry
49 a distinct configuration. See
50 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
51 for details about journal namespaces.</para>
54 <xi:include href="standard-conf.xml" xpointer="main-conf" />
57 <title>Options</title>
59 <para>All options are configured in the
60 [Journal] section:</para>
62 <variablelist class='config-directives'>
65 <term><varname>Storage=</varname></term>
67 <listitem><para>Controls where to store journal data. One of <literal>volatile</literal>,
68 <literal>persistent</literal>, <literal>auto</literal> and <literal>none</literal>. If
69 <literal>volatile</literal>, journal log data will be stored only in memory, i.e. below the
70 <filename>/run/log/journal</filename> hierarchy (which is created if needed). If
71 <literal>persistent</literal>, data will be stored preferably on disk, i.e. below the
72 <filename>/var/log/journal</filename> hierarchy (which is created if needed), with a fallback to
73 <filename>/run/log/journal</filename> (which is created if needed), during early boot and if the disk
74 is not writable. <literal>auto</literal> behaves like <literal>persistent</literal> if the
75 <filename>/var/log/journal</filename> directory exists, and <literal>volatile</literal> otherwise
76 (the existence of the directory controls the storage mode). <literal>none</literal> turns off all
77 storage, all log data received will be dropped (but forwarding to other targets, such as the console,
78 the kernel log buffer, or a syslog socket will still work). Defaults to <literal>auto</literal> in
79 the default journal namespace, and <literal>persistent</literal> in all others.</para>
81 <para>Note that journald will initially use volatile storage, until a call to
82 <command>journalctl --flush</command> (or sending <constant>SIGUSR1</constant> to journald) will cause
83 it to switch to persistent logging (under the conditions mentioned above). This is done automatically
84 on boot via <literal>systemd-journal-flush.service</literal>.</para>
86 <para>Note that when this option is changed to <literal>volatile</literal>, existing persistent data
87 is not removed. In the other direction,
88 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> with
89 the <option>--flush</option> option may be used to move volatile data to persistent storage.</para>
91 <para>When journal namespacing (see <varname>LogNamespace=</varname> in
92 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>) is
93 used, setting <varname>Storage=</varname> to <literal>volatile</literal> or <literal>auto</literal>
94 will not have an effect on the creation of the per-namespace logs directory in
95 <filename>/var/log/journal/</filename>, as the <filename>systemd-journald@.service</filename> service
96 file by default carries <varname>LogsDirectory=</varname>. To turn that off, add a unit file drop-in
97 file that sets <varname>LogsDirectory=</varname> to an empty string.</para>
99 <para>Note that per-user journal files are not supported unless persistent storage is enabled, thus
100 making <command>journalctl --user</command> unavailable.</para>
102 <xi:include href="version-info.xml" xpointer="v186"/>
107 <term><varname>Compress=</varname></term>
109 <listitem><para>Can take a boolean value. If enabled (the
110 default), data objects that shall be stored in the journal
111 and are larger than the default threshold of 512 bytes are
112 compressed before they are written to the file system. It
113 can also be set to a number of bytes to specify the
114 compression threshold directly. Suffixes like K, M, and G
115 can be used to specify larger units.</para></listitem>
119 <term><varname>Seal=</varname></term>
121 <listitem><para>Takes a boolean value. If enabled (the
122 default), and a sealing key is available (as created by
123 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
124 <option>--setup-keys</option> command), Forward Secure Sealing
125 (FSS) for all persistent journal files is enabled. FSS is
127 url="https://eprint.iacr.org/2013/397">Seekable Sequential Key
128 Generators</ulink> by G. A. Marson and B. Poettering
129 (doi:10.1007/978-3-642-40203-6_7) and may be used to protect
130 journal files from unnoticed alteration.</para>
132 <xi:include href="version-info.xml" xpointer="v189"/></listitem>
136 <term><varname>SplitMode=</varname></term>
138 <listitem><para>Controls whether to split up journal files per user, either <literal>uid</literal> or
139 <literal>none</literal>. Split journal files are primarily useful for access control: on UNIX/Linux access
140 control is managed per file, and the journal daemon will assign users read access to their journal files. If
141 <literal>uid</literal>, all regular users (with UID outside the range of system users, dynamic service users,
142 and the nobody user) will each get their own journal files, and system users will log to the system journal.
143 See <ulink url="https://systemd.io/UIDS-GIDS">Users, Groups, UIDs and GIDs on systemd systems</ulink>
144 for more details about UID ranges.
145 If <literal>none</literal>, journal files are not split up by user and all messages are
146 instead stored in the single system journal. In this mode unprivileged users generally do not have access to
147 their own log data. Note that splitting up journal files by user is only available for journals stored
148 persistently. If journals are stored on volatile storage (see <varname>Storage=</varname> above), only a single
149 journal file is used. Defaults to <literal>uid</literal>.</para>
151 <xi:include href="version-info.xml" xpointer="v190"/></listitem>
155 <term><varname>RateLimitIntervalSec=</varname></term>
156 <term><varname>RateLimitBurst=</varname></term>
158 <listitem><para>Configures the rate limiting that is applied
159 to all messages generated on the system. If, in the time
160 interval defined by <varname>RateLimitIntervalSec=</varname>,
161 more messages than specified in
162 <varname>RateLimitBurst=</varname> are logged by a service,
163 all further messages within the interval are dropped until the
164 interval is over. A message about the number of dropped
165 messages is generated. This rate limiting is applied
166 per-service, so that two services which log do not interfere
167 with each other's limits. Defaults to 10000 messages in 30s.
168 The time specification for
169 <varname>RateLimitIntervalSec=</varname> may be specified in the
170 following units: <literal>s</literal>, <literal>min</literal>,
171 <literal>h</literal>, <literal>ms</literal>,
172 <literal>us</literal>. To turn off any kind of rate limiting,
173 set either value to 0.</para>
175 <para>Note that the effective rate limit is multiplied by a
176 factor derived from the available free disk space for the journal.
177 Currently, this factor is calculated using the base 2 logarithm.</para>
180 <title>Example <varname>RateLimitBurst=</varname> rate
181 modifications by the available disk space</title>
183 <colspec colname='freespace' />
184 <colspec colname='multiplier' />
187 <entry>Available Disk Space</entry>
188 <entry>Burst Multiplier</entry>
193 <entry><= 1MB</entry>
197 <entry><= 16MB</entry>
201 <entry><= 256MB</entry>
205 <entry><= 4GB</entry>
209 <entry><= 64GB</entry>
213 <entry><= 1TB</entry>
220 <para>If a service provides rate limits for itself through
221 <varname>LogRateLimitIntervalSec=</varname> and/or <varname>LogRateLimitBurst=</varname>
222 in <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
223 those values will override the settings specified here.</para>
228 <term><varname>SystemMaxUse=</varname></term>
229 <term><varname>SystemKeepFree=</varname></term>
230 <term><varname>SystemMaxFileSize=</varname></term>
231 <term><varname>SystemMaxFiles=</varname></term>
232 <term><varname>RuntimeMaxUse=</varname></term>
233 <term><varname>RuntimeKeepFree=</varname></term>
234 <term><varname>RuntimeMaxFileSize=</varname></term>
235 <term><varname>RuntimeMaxFiles=</varname></term>
237 <listitem><para>Enforce size limits on the journal files
238 stored. The options prefixed with <literal>System</literal>
239 apply to the journal files when stored on a persistent file
240 system, more specifically
241 <filename>/var/log/journal</filename>. The options prefixed
242 with <literal>Runtime</literal> apply to the journal files
243 when stored on a volatile in-memory file system, more
244 specifically <filename>/run/log/journal</filename>. The former
245 is used only when <filename>/var/</filename> is mounted,
246 writable, and the directory
247 <filename>/var/log/journal</filename> exists. Otherwise, only
248 the latter applies. Note that this means that during early
249 boot and if the administrator disabled persistent logging,
250 only the latter options apply, while the former apply if
251 persistent logging is enabled and the system is fully booted
252 up. <command>journalctl</command> and
253 <command>systemd-journald</command> ignore all files with
254 names not ending with <literal>.journal</literal> or
255 <literal>.journal~</literal>, so only such files, located in
256 the appropriate directories, are taken into account when
257 calculating current disk usage.</para>
259 <para><varname>SystemMaxUse=</varname> and
260 <varname>RuntimeMaxUse=</varname> control how much disk space
261 the journal may use up at most.
262 <varname>SystemKeepFree=</varname> and
263 <varname>RuntimeKeepFree=</varname> control how much disk
264 space systemd-journald shall leave free for other uses.
265 <command>systemd-journald</command> will respect both limits
266 and use the smaller of the two values.</para>
268 <para>The first pair defaults to 10% and the second to 15% of
269 the size of the respective file system, but each value is
270 capped to 4G. If the file system is nearly full and either
271 <varname>SystemKeepFree=</varname> or
272 <varname>RuntimeKeepFree=</varname> are violated when
273 systemd-journald is started, the limit will be raised to the
274 percentage that is actually free. This means that if there was
275 enough free space before and journal files were created, and
276 subsequently something else causes the file system to fill up,
277 journald will stop using more space, but it will not be
278 removing existing files to reduce the footprint again,
279 either. Also note that only archived files are deleted to reduce the
280 space occupied by journal files. This means that, in effect, there might
281 still be more space used than <varname>SystemMaxUse=</varname> or
282 <varname>RuntimeMaxUse=</varname> limit after a vacuuming operation is
285 <para><varname>SystemMaxFileSize=</varname> and <varname>RuntimeMaxFileSize=</varname> control how
286 large individual journal files may grow at most. This influences the granularity in which disk space
287 is made available through rotation, i.e. deletion of historic data. Defaults to one eighth of the
288 values configured with <varname>SystemMaxUse=</varname> and <varname>RuntimeMaxUse=</varname> capped
289 to 128M, so that usually seven rotated journal files are kept as history. If the journal compact
290 mode is enabled (enabled by default), the maximum file size is capped to 4G.</para>
292 <para>Specify values in bytes or use K, M, G, T, P, E as units for the specified sizes (equal to
293 1024, 1024², … bytes). Note that size limits are enforced synchronously when journal files are
294 extended, and no explicit rotation step triggered by time is needed.</para>
296 <para><varname>SystemMaxFiles=</varname> and
297 <varname>RuntimeMaxFiles=</varname> control how many
298 individual journal files to keep at most. Note that only
299 archived files are deleted to reduce the number of files until
300 this limit is reached; active files will stay around. This
301 means that, in effect, there might still be more journal files
302 around in total than this limit after a vacuuming operation is
303 complete. This setting defaults to 100.</para></listitem>
307 <term><varname>MaxFileSec=</varname></term>
309 <listitem><para>The maximum time to store entries in a single
310 journal file before rotating to the next one. Normally,
311 time-based rotation should not be required as size-based
312 rotation with options such as
313 <varname>SystemMaxFileSize=</varname> should be sufficient to
314 ensure that journal files do not grow without bounds. However,
315 to ensure that not too much data is lost at once when old
316 journal files are deleted, it might make sense to change this
317 value from the default of one month. Set to 0 to turn off this
318 feature. This setting takes time values which may be suffixed
319 with the units <literal>year</literal>,
320 <literal>month</literal>, <literal>week</literal>,
321 <literal>day</literal>, <literal>h</literal> or
322 <literal>m</literal> to override the default time unit of
325 <xi:include href="version-info.xml" xpointer="v195"/></listitem>
329 <term><varname>MaxRetentionSec=</varname></term>
331 <listitem><para>The maximum time to store journal entries.
332 This controls whether journal files containing entries older
333 than the specified time span are deleted. Normally, time-based
334 deletion of old journal files should not be required as
335 size-based deletion with options such as
336 <varname>SystemMaxUse=</varname> should be sufficient to
337 ensure that journal files do not grow without bounds. However,
338 to enforce data retention policies, it might make sense to
339 change this value from the default of 0 (which turns off this
340 feature). This setting also takes time values which may be
341 suffixed with the units <literal>year</literal>,
342 <literal>month</literal>, <literal>week</literal>,
343 <literal>day</literal>, <literal>h</literal> or <literal>
344 m</literal> to override the default time unit of
347 <xi:include href="version-info.xml" xpointer="v195"/></listitem>
351 <term><varname>SyncIntervalSec=</varname></term>
353 <listitem><para>The timeout before synchronizing journal files
354 to disk. After syncing, journal files are placed in the
355 OFFLINE state. Note that syncing is unconditionally done
356 immediately after a log message of priority CRIT, ALERT or
357 EMERG has been logged. This setting hence applies only to
358 messages of the levels ERR, WARNING, NOTICE, INFO, DEBUG. The
359 default timeout is 5 minutes. </para>
361 <xi:include href="version-info.xml" xpointer="v199"/></listitem>
365 <term><varname>ForwardToSyslog=</varname></term>
366 <term><varname>ForwardToKMsg=</varname></term>
367 <term><varname>ForwardToConsole=</varname></term>
368 <term><varname>ForwardToWall=</varname></term>
370 <listitem><para>Control whether log messages received by the journal daemon shall be forwarded to a
371 traditional syslog daemon, to the kernel log buffer (kmsg), to the system console, or sent as wall
372 messages to all logged-in users. These options take boolean arguments. If forwarding to syslog is
373 enabled but nothing reads messages from the socket, forwarding to syslog has no effect. By default,
374 only forwarding to wall is enabled. These settings may be overridden at boot time with the kernel
375 command line options <literal>systemd.journald.forward_to_syslog</literal>,
376 <literal>systemd.journald.forward_to_kmsg</literal>,
377 <literal>systemd.journald.forward_to_console</literal>, and
378 <literal>systemd.journald.forward_to_wall</literal>. If the option name is specified without
379 <literal>=</literal> and the following argument, true is assumed. Otherwise, the argument is parsed
382 <para>When forwarding to the console, the TTY to log to can be changed with
383 <varname>TTYPath=</varname>, described below.</para>
385 <para>When forwarding to the kernel log buffer (kmsg), make sure to select a suitably large size for
386 the log buffer, for example by adding <literal>log_buf_len=8M</literal> to the kernel command line.
387 <command>systemd</command> will automatically disable kernel's rate-limiting applied to userspace
388 processes (equivalent to setting <literal>printk.devkmsg=on</literal>).</para></listitem>
390 <para>Note: Forwarding is performed synchronously within journald, and may significantly affect its
391 performance. This is particularly relevant when using ForwardToConsole=yes in cloud environments,
392 where the console is often a slow, virtual serial port. Since journald is implemented as a
393 conventional single-process daemon, forwarding to a completely hung console will block journald.
394 This can have a cascading effect resulting in any services synchronously logging to the blocked
395 journal also becoming blocked. Unless actively debugging/developing something, it's generally
396 preferable to setup a <command>journalctl --follow</command> style service redirected to the
397 console, instead of ForwardToConsole=yes, for production use.</para>
401 <term><varname>MaxLevelStore=</varname></term>
402 <term><varname>MaxLevelSyslog=</varname></term>
403 <term><varname>MaxLevelKMsg=</varname></term>
404 <term><varname>MaxLevelConsole=</varname></term>
405 <term><varname>MaxLevelWall=</varname></term>
407 <listitem><para>Controls the maximum log level of messages
408 that are stored in the journal, forwarded to syslog, kmsg, the
409 console or wall (if that is enabled, see above). As argument,
411 <literal>emerg</literal>,
412 <literal>alert</literal>,
413 <literal>crit</literal>,
414 <literal>err</literal>,
415 <literal>warning</literal>,
416 <literal>notice</literal>,
417 <literal>info</literal>,
418 <literal>debug</literal>,
419 or integer values in the range of 0–7 (corresponding to the
420 same levels). Messages equal or below the log level specified
421 are stored/forwarded, messages above are dropped. Defaults to
422 <literal>debug</literal> for <varname>MaxLevelStore=</varname>
423 and <varname>MaxLevelSyslog=</varname>, to ensure that the all
424 messages are stored in the journal and forwarded to syslog.
426 <literal>notice</literal> for <varname>MaxLevelKMsg=</varname>,
427 <literal>info</literal> for <varname>MaxLevelConsole=</varname>,
428 and <literal>emerg</literal> for
429 <varname>MaxLevelWall=</varname>. These settings may be
430 overridden at boot time with the kernel command line options
431 <literal>systemd.journald.max_level_store=</literal>,
432 <literal>systemd.journald.max_level_syslog=</literal>,
433 <literal>systemd.journald.max_level_kmsg=</literal>,
434 <literal>systemd.journald.max_level_console=</literal>,
435 <literal>systemd.journald.max_level_wall=</literal>.</para>
437 <xi:include href="version-info.xml" xpointer="v185"/>
442 <term><varname>ReadKMsg=</varname></term>
444 <listitem><para>Takes a boolean value. If enabled <command>systemd-journal</command> processes
445 <filename>/dev/kmsg</filename> messages generated by the kernel. In the default journal namespace
446 this option is enabled by default, it is disabled in all others.</para>
448 <xi:include href="version-info.xml" xpointer="v235"/></listitem>
452 <term><varname>Audit=</varname></term>
454 <listitem><para>Takes a boolean value. If enabled <command>systemd-journald</command> will turn on
455 kernel auditing on start-up. If disabled it will turn it off. If unset it will neither enable nor
456 disable it, leaving the previous state unchanged. This means if another tool turns on auditing even
457 if <command>systemd-journald</command> left it off, it will still collect the generated
458 messages. Defaults to on.</para>
460 <para>Note that this option does not control whether <command>systemd-journald</command> collects
461 generated audit records, it just controls whether it tells the kernel to generate them. If you need
462 to prevent <command>systemd-journald</command> from collecting the generated messages, the socket
463 unit <literal>systemd-journald-audit.socket</literal> can be disabled and in this case this setting
464 is without effect.</para>
466 <xi:include href="version-info.xml" xpointer="v246"/>
471 <term><varname>TTYPath=</varname></term>
473 <listitem><para>Change the console TTY to use if
474 <varname>ForwardToConsole=yes</varname> is used. Defaults to
475 <filename>/dev/console</filename>.</para>
477 <xi:include href="version-info.xml" xpointer="v185"/></listitem>
481 <term><varname>LineMax=</varname></term>
483 <listitem><para>The maximum line length to permit when converting stream logs into record logs. When a systemd
484 unit's standard output/error are connected to the journal via a stream socket, the data read is split into
485 individual log records at newline (<literal>\n</literal>, ASCII 10) and <constant>NUL</constant> characters. If no such delimiter is
486 read for the specified number of bytes a hard log record boundary is artificially inserted, breaking up overly
487 long lines into multiple log records. Selecting overly large values increases the possible memory usage of the
488 Journal daemon for each stream client, as in the worst case the journal daemon needs to buffer the specified
489 number of bytes in memory before it can flush a new log record to disk. Also note that permitting overly large
490 line maximum line lengths affects compatibility with traditional log protocols as log records might not fit
491 anymore into a single <constant>AF_UNIX</constant> or <constant>AF_INET</constant> datagram. Takes a size in
492 bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes,
493 Gigabytes, or Terabytes (with the base 1024), respectively. Defaults to 48K, which is relatively large but
494 still small enough so that log records likely fit into network datagrams along with extra room for
495 metadata. Note that values below 79 are not accepted and will be bumped to 79.</para>
497 <xi:include href="version-info.xml" xpointer="v235"/></listitem>
505 <title>Forwarding to traditional syslog daemons</title>
508 Journal events can be transferred to a different logging daemon
509 in two different ways. With the first method, messages are
510 immediately forwarded to a socket
511 (<filename>/run/systemd/journal/syslog</filename>), where the
512 traditional syslog daemon can read them. This method is
513 controlled by the <varname>ForwardToSyslog=</varname> option. With a
514 second method, a syslog daemon behaves like a normal journal
515 client, and reads messages from the journal files, similarly to
516 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
517 With this, messages do not have to be read immediately,
518 which allows a logging daemon which is only started late in boot
519 to access all messages since the start of the system. In
520 addition, full structured meta-data is available to it. This
521 method of course is available only if the messages are stored in
522 a journal file at all. So it will not work if
523 <varname>Storage=none</varname> is set. It should be noted that
524 usually the <emphasis>second</emphasis> method is used by syslog
525 daemons, so the <varname>Storage=</varname> option, and not the
526 <varname>ForwardToSyslog=</varname> option, is relevant for them.
531 <title>See Also</title>
533 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
534 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
535 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
536 <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
537 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>