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