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