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