1JOURNALD.CONF(5) journald.conf JOURNALD.CONF(5)
2
3
4
6 journald.conf, journald.conf.d, journald@.conf - Journal service
7 configuration files
8
10 /etc/systemd/journald.conf
11
12 /etc/systemd/journald.conf.d/*.conf
13
14 /run/systemd/journald.conf.d/*.conf
15
16 /usr/lib/systemd/journald.conf.d/*.conf
17
18 /etc/systemd/journald@NAMESPACE.conf
19
20 /etc/systemd/journald@NAMESPACE.conf.d/*.conf
21
22 /run/systemd/journald@NAMESPACE.conf.d/*.conf
23
24 /usr/lib/systemd/journald@NAMESPACE.conf.d/*.conf
25
27 These files configure various parameters of the systemd journal
28 service, systemd-journald.service(8). See systemd.syntax(7) for a
29 general description of the syntax.
30
31 The systemd-journald instance managing the default namespace is
32 configured by /etc/systemd/journald.conf and associated drop-ins.
33 Instances managing other namespaces read
34 /etc/systemd/journald@NAMESPACE.conf and associated drop-ins with the
35 namespace identifier filled in. This allows each namespace to carry a
36 distinct configuration. See systemd-journald.service(8) for details
37 about journal namespaces.
38
40 The default configuration is set during compilation, so configuration
41 is only needed when it is necessary to deviate from those defaults.
42 Initially, the main configuration file in /etc/systemd/ contains
43 commented out entries showing the defaults as a guide to the
44 administrator. Local overrides can be created by editing this file or
45 by creating drop-ins, as described below. Using drop-ins for local
46 configuration is recommended over modifications to the main
47 configuration file.
48
49 In addition to the "main" configuration file, drop-in configuration
50 snippets are read from /usr/lib/systemd/*.conf.d/,
51 /usr/local/lib/systemd/*.conf.d/, and /etc/systemd/*.conf.d/. Those
52 drop-ins have higher precedence and override the main configuration
53 file. Files in the *.conf.d/ configuration subdirectories are sorted by
54 their filename in lexicographic order, regardless of in which of the
55 subdirectories they reside. When multiple files specify the same
56 option, for options which accept just a single value, the entry in the
57 file sorted last takes precedence, and for options which accept a list
58 of values, entries are collected as they occur in the sorted files.
59
60 When packages need to customize the configuration, they can install
61 drop-ins under /usr/. Files in /etc/ are reserved for the local
62 administrator, who may use this logic to override the configuration
63 files installed by vendor packages. Drop-ins have to be used to
64 override package drop-ins, since the main configuration file has lower
65 precedence. It is recommended to prefix all filenames in those
66 subdirectories with a two-digit number and a dash, to simplify the
67 ordering of the files.
68
69 To disable a configuration file supplied by the vendor, the recommended
70 way is to place a symlink to /dev/null in the configuration directory
71 in /etc/, with the same filename as the vendor configuration file.
72
74 All options are configured in the [Journal] section:
75
76 Storage=
77 Controls where to store journal data. One of "volatile",
78 "persistent", "auto" and "none". If "volatile", journal log data
79 will be stored only in memory, i.e. below the /run/log/journal
80 hierarchy (which is created if needed). If "persistent", data will
81 be stored preferably on disk, i.e. below the /var/log/journal
82 hierarchy (which is created if needed), with a fallback to
83 /run/log/journal (which is created if needed), during early boot
84 and if the disk is not writable. "auto" behaves like "persistent"
85 if the /var/log/journal directory exists, and "volatile" otherwise
86 (the existence of the directory controls the storage mode). "none"
87 turns off all storage, all log data received will be dropped (but
88 forwarding to other targets, such as the console, the kernel log
89 buffer, or a syslog socket will still work). Defaults to "auto" in
90 the default journal namespace, and "persistent" in all others.
91
92 Note that journald will initially use volatile storage, until a
93 call to journalctl --flush (or sending SIGUSR1 to journald) will
94 cause it to switch to persistent logging (under the conditions
95 mentioned above). This is done automatically on boot via
96 "systemd-journal-flush.service".
97
98 Note that when this option is changed to "volatile", existing
99 persistent data is not removed. In the other direction,
100 journalctl(1) with the --flush option may be used to move volatile
101 data to persistent storage.
102
103 When journal namespacing (see LogNamespace= in systemd.exec(5)) is
104 used, setting Storage= to "volatile" or "auto" will not have an
105 effect on the creation of the per-namespace logs directory in
106 /var/log/journal/, as the systemd-journald@.service service file by
107 default carries LogsDirectory=. To turn that off, add a unit file
108 drop-in file that sets LogsDirectory= to an empty string.
109
110 Compress=
111 Can take a boolean value. If enabled (the default), data objects
112 that shall be stored in the journal and are larger than the default
113 threshold of 512 bytes are compressed before they are written to
114 the file system. It can also be set to a number of bytes to specify
115 the compression threshold directly. Suffixes like K, M, and G can
116 be used to specify larger units.
117
118 Seal=
119 Takes a boolean value. If enabled (the default), and a sealing key
120 is available (as created by journalctl(1)'s --setup-keys command),
121 Forward Secure Sealing (FSS) for all persistent journal files is
122 enabled. FSS is based on Seekable Sequential Key Generators[1] by
123 G. A. Marson and B. Poettering (doi:10.1007/978-3-642-40203-6_7)
124 and may be used to protect journal files from unnoticed alteration.
125
126 SplitMode=
127 Controls whether to split up journal files per user, either "uid"
128 or "none". Split journal files are primarily useful for access
129 control: on UNIX/Linux access control is managed per file, and the
130 journal daemon will assign users read access to their journal
131 files. If "uid", all regular users (with UID outside the range of
132 system users, dynamic service users, and the nobody user) will each
133 get their own journal files, and system users will log to the
134 system journal. See Users, Groups, UIDs and GIDs on systemd
135 systems[2] for more details about UID ranges. If "none", journal
136 files are not split up by user and all messages are instead stored
137 in the single system journal. In this mode unprivileged users
138 generally do not have access to their own log data. Note that
139 splitting up journal files by user is only available for journals
140 stored persistently. If journals are stored on volatile storage
141 (see Storage= above), only a single journal file is used. Defaults
142 to "uid".
143
144 RateLimitIntervalSec=, RateLimitBurst=
145 Configures the rate limiting that is applied to all messages
146 generated on the system. If, in the time interval defined by
147 RateLimitIntervalSec=, more messages than specified in
148 RateLimitBurst= are logged by a service, all further messages
149 within the interval are dropped until the interval is over. A
150 message about the number of dropped messages is generated. This
151 rate limiting is applied per-service, so that two services which
152 log do not interfere with each other's limits. Defaults to 10000
153 messages in 30s. The time specification for RateLimitIntervalSec=
154 may be specified in the following units: "s", "min", "h", "ms",
155 "us". To turn off any kind of rate limiting, set either value to 0.
156
157 Note that the effective rate limit is multiplied by a factor
158 derived from the available free disk space for the journal.
159 Currently, this factor is calculated using the base 2 logarithm.
160
161 Table 1. Example RateLimitBurst= rate modifications by the
162 available disk space
163 ┌─────────────────────┬──────────────────┐
164 │Available Disk Space │ Burst Multiplier │
165 ├─────────────────────┼──────────────────┤
166 │<= 1MB │ 1 │
167 ├─────────────────────┼──────────────────┤
168 │<= 16MB │ 2 │
169 ├─────────────────────┼──────────────────┤
170 │<= 256MB │ 3 │
171 ├─────────────────────┼──────────────────┤
172 │<= 4GB │ 4 │
173 ├─────────────────────┼──────────────────┤
174 │<= 64GB │ 5 │
175 ├─────────────────────┼──────────────────┤
176 │<= 1TB │ 6 │
177 └─────────────────────┴──────────────────┘
178 If a service provides rate limits for itself through
179 LogRateLimitIntervalSec= and/or LogRateLimitBurst= in
180 systemd.exec(5), those values will override the settings specified
181 here.
182
183 SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, SystemMaxFiles=,
184 RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=, RuntimeMaxFiles=
185 Enforce size limits on the journal files stored. The options
186 prefixed with "System" apply to the journal files when stored on a
187 persistent file system, more specifically /var/log/journal. The
188 options prefixed with "Runtime" apply to the journal files when
189 stored on a volatile in-memory file system, more specifically
190 /run/log/journal. The former is used only when /var/ is mounted,
191 writable, and the directory /var/log/journal exists. Otherwise,
192 only the latter applies. Note that this means that during early
193 boot and if the administrator disabled persistent logging, only the
194 latter options apply, while the former apply if persistent logging
195 is enabled and the system is fully booted up. journalctl and
196 systemd-journald ignore all files with names not ending with
197 ".journal" or ".journal~", so only such files, located in the
198 appropriate directories, are taken into account when calculating
199 current disk usage.
200
201 SystemMaxUse= and RuntimeMaxUse= control how much disk space the
202 journal may use up at most. SystemKeepFree= and RuntimeKeepFree=
203 control how much disk space systemd-journald shall leave free for
204 other uses. systemd-journald will respect both limits and use the
205 smaller of the two values.
206
207 The first pair defaults to 10% and the second to 15% of the size of
208 the respective file system, but each value is capped to 4G. If the
209 file system is nearly full and either SystemKeepFree= or
210 RuntimeKeepFree= are violated when systemd-journald is started, the
211 limit will be raised to the percentage that is actually free. This
212 means that if there was enough free space before and journal files
213 were created, and subsequently something else causes the file
214 system to fill up, journald will stop using more space, but it will
215 not be removing existing files to reduce the footprint again,
216 either. Also note that only archived files are deleted to reduce
217 the space occupied by journal files. This means that, in effect,
218 there might still be more space used than SystemMaxUse= or
219 RuntimeMaxUse= limit after a vacuuming operation is complete.
220
221 SystemMaxFileSize= and RuntimeMaxFileSize= control how large
222 individual journal files may grow at most. This influences the
223 granularity in which disk space is made available through rotation,
224 i.e. deletion of historic data. Defaults to one eighth of the
225 values configured with SystemMaxUse= and RuntimeMaxUse= capped to
226 128M, so that usually seven rotated journal files are kept as
227 history. If the journal compact mode is enabled (enabled by
228 default), the maximum file size is capped to 4G.
229
230 Specify values in bytes or use K, M, G, T, P, E as units for the
231 specified sizes (equal to 1024, 1024², ... bytes). Note that size
232 limits are enforced synchronously when journal files are extended,
233 and no explicit rotation step triggered by time is needed.
234
235 SystemMaxFiles= and RuntimeMaxFiles= control how many individual
236 journal files to keep at most. Note that only archived files are
237 deleted to reduce the number of files until this limit is reached;
238 active files will stay around. This means that, in effect, there
239 might still be more journal files around in total than this limit
240 after a vacuuming operation is complete. This setting defaults to
241 100.
242
243 MaxFileSec=
244 The maximum time to store entries in a single journal file before
245 rotating to the next one. Normally, time-based rotation should not
246 be required as size-based rotation with options such as
247 SystemMaxFileSize= should be sufficient to ensure that journal
248 files do not grow without bounds. However, to ensure that not too
249 much data is lost at once when old journal files are deleted, it
250 might make sense to change this value from the default of one
251 month. Set to 0 to turn off this feature. This setting takes time
252 values which may be suffixed with the units "year", "month",
253 "week", "day", "h" or "m" to override the default time unit of
254 seconds.
255
256 MaxRetentionSec=
257 The maximum time to store journal entries. This controls whether
258 journal files containing entries older than the specified time span
259 are deleted. Normally, time-based deletion of old journal files
260 should not be required as size-based deletion with options such as
261 SystemMaxUse= should be sufficient to ensure that journal files do
262 not grow without bounds. However, to enforce data retention
263 policies, it might make sense to change this value from the default
264 of 0 (which turns off this feature). This setting also takes time
265 values which may be suffixed with the units "year", "month",
266 "week", "day", "h" or " m" to override the default time unit of
267 seconds.
268
269 SyncIntervalSec=
270 The timeout before synchronizing journal files to disk. After
271 syncing, journal files are placed in the OFFLINE state. Note that
272 syncing is unconditionally done immediately after a log message of
273 priority CRIT, ALERT or EMERG has been logged. This setting hence
274 applies only to messages of the levels ERR, WARNING, NOTICE, INFO,
275 DEBUG. The default timeout is 5 minutes.
276
277 ForwardToSyslog=, ForwardToKMsg=, ForwardToConsole=, ForwardToWall=
278 Control whether log messages received by the journal daemon shall
279 be forwarded to a traditional syslog daemon, to the kernel log
280 buffer (kmsg), to the system console, or sent as wall messages to
281 all logged-in users. These options take boolean arguments. If
282 forwarding to syslog is enabled but nothing reads messages from the
283 socket, forwarding to syslog has no effect. By default, only
284 forwarding to wall is enabled. These settings may be overridden at
285 boot time with the kernel command line options
286 "systemd.journald.forward_to_syslog",
287 "systemd.journald.forward_to_kmsg",
288 "systemd.journald.forward_to_console", and
289 "systemd.journald.forward_to_wall". If the option name is specified
290 without "=" and the following argument, true is assumed. Otherwise,
291 the argument is parsed as a boolean.
292
293 When forwarding to the console, the TTY to log to can be changed
294 with TTYPath=, described below.
295
296 When forwarding to the kernel log buffer (kmsg), make sure to
297 select a suitably large size for the log buffer, for example by
298 adding "log_buf_len=8M" to the kernel command line. systemd will
299 automatically disable kernel's rate-limiting applied to userspace
300 processes (equivalent to setting "printk.devkmsg=on").
301
302 MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=,
303 MaxLevelWall=
304 Controls the maximum log level of messages that are stored in the
305 journal, forwarded to syslog, kmsg, the console or wall (if that is
306 enabled, see above). As argument, takes one of "emerg", "alert",
307 "crit", "err", "warning", "notice", "info", "debug", or integer
308 values in the range of 0–7 (corresponding to the same levels).
309 Messages equal or below the log level specified are
310 stored/forwarded, messages above are dropped. Defaults to "debug"
311 for MaxLevelStore= and MaxLevelSyslog=, to ensure that the all
312 messages are stored in the journal and forwarded to syslog.
313 Defaults to "notice" for MaxLevelKMsg=, "info" for
314 MaxLevelConsole=, and "emerg" for MaxLevelWall=. These settings may
315 be overridden at boot time with the kernel command line options
316 "systemd.journald.max_level_store=",
317 "systemd.journald.max_level_syslog=",
318 "systemd.journald.max_level_kmsg=",
319 "systemd.journald.max_level_console=",
320 "systemd.journald.max_level_wall=".
321
322 ReadKMsg=
323 Takes a boolean value. If enabled systemd-journal processes
324 /dev/kmsg messages generated by the kernel. In the default journal
325 namespace this option is enabled by default, it is disabled in all
326 others.
327
328 Audit=
329 Takes a boolean value. If enabled systemd-journald will turn on
330 kernel auditing on start-up. If disabled it will turn it off. If
331 unset it will neither enable nor disable it, leaving the previous
332 state unchanged. This means if another tool turns on auditing even
333 if systemd-journald left it off, it will still collect the
334 generated messages. Defaults to on.
335
336 Note that this option does not control whether systemd-journald
337 collects generated audit records, it just controls whether it tells
338 the kernel to generate them. If you need to prevent
339 systemd-journald from collecting the generated messages, the socket
340 unit "systemd-journald-audit.socket" can be disabled and in this
341 case this setting is without effect.
342
343 TTYPath=
344 Change the console TTY to use if ForwardToConsole=yes is used.
345 Defaults to /dev/console.
346
347 LineMax=
348 The maximum line length to permit when converting stream logs into
349 record logs. When a systemd unit's standard output/error are
350 connected to the journal via a stream socket, the data read is
351 split into individual log records at newline ("\n", ASCII 10) and
352 NUL characters. If no such delimiter is read for the specified
353 number of bytes a hard log record boundary is artificially
354 inserted, breaking up overly long lines into multiple log records.
355 Selecting overly large values increases the possible memory usage
356 of the Journal daemon for each stream client, as in the worst case
357 the journal daemon needs to buffer the specified number of bytes in
358 memory before it can flush a new log record to disk. Also note that
359 permitting overly large line maximum line lengths affects
360 compatibility with traditional log protocols as log records might
361 not fit anymore into a single AF_UNIX or AF_INET datagram. Takes a
362 size in bytes. If the value is suffixed with K, M, G or T, the
363 specified size is parsed as Kilobytes, Megabytes, Gigabytes, or
364 Terabytes (with the base 1024), respectively. Defaults to 48K,
365 which is relatively large but still small enough so that log
366 records likely fit into network datagrams along with extra room for
367 metadata. Note that values below 79 are not accepted and will be
368 bumped to 79.
369
371 Journal events can be transferred to a different logging daemon in two
372 different ways. With the first method, messages are immediately
373 forwarded to a socket (/run/systemd/journal/syslog), where the
374 traditional syslog daemon can read them. This method is controlled by
375 the ForwardToSyslog= option. With a second method, a syslog daemon
376 behaves like a normal journal client, and reads messages from the
377 journal files, similarly to journalctl(1). With this, messages do not
378 have to be read immediately, which allows a logging daemon which is
379 only started late in boot to access all messages since the start of the
380 system. In addition, full structured meta-data is available to it. This
381 method of course is available only if the messages are stored in a
382 journal file at all. So it will not work if Storage=none is set. It
383 should be noted that usually the second method is used by syslog
384 daemons, so the Storage= option, and not the ForwardToSyslog= option,
385 is relevant for them.
386
388 systemd(1), systemd-journald.service(8), journalctl(1),
389 systemd.journal-fields(7), systemd-system.conf(5)
390
392 1. Seekable Sequential Key Generators
393 https://eprint.iacr.org/2013/397
394
395 2. Users, Groups, UIDs and GIDs on systemd systems
396 https://systemd.io/UIDS-GIDS
397
398
399
400systemd 253 JOURNALD.CONF(5)