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