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