diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-22 10:22:24 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-22 10:22:24 +0200 |
commit | ec20fe5ffb8a00469bab209fff6c069bb93c6db2 (patch) | |
tree | eb6658381ac31b9168c2a147f7f27248be6576e4 /man/journald.conf.xml | |
parent | Merge pull request #6853 from sourcejedi/GetAll (diff) | |
download | systemd-ec20fe5ffb8a00469bab209fff6c069bb93c6db2.tar.xz systemd-ec20fe5ffb8a00469bab209fff6c069bb93c6db2.zip |
journald: make maximum size of stream log lines configurable and bump it to 48K (#6838)
This adds a new setting LineMax= to journald.conf, and sets it by
default to 48K. When we convert stream-based stdout/stderr logging into
record-based log entries, read up to the specified amount of bytes
before forcing a line-break.
This also makes three related changes:
- When a NUL byte is read we'll not recognize this as alternative line
break, instead of silently dropping everything after it. (see #4863)
- The reason for a line-break is now encoded in the log record, if it
wasn't a plain newline. Specifically, we distuingish "nul",
"line-max" and "eof", for line breaks due to NUL byte, due to the
maximum line length as configured with LineMax= or due to end of
stream. This data is stored in the new implicit _LINE_BREAK= field.
It's not synthesized for plain \n line breaks.
- A randomized 128bit ID is assigned to each log stream.
With these three changes in place it's (mostly) possible to reconstruct
the original byte streams from log data, as (most) of the context of
the conversion from the byte stream to log records is saved now. (So,
the only bits we still drop are empty lines. Which might be something to
look into in a future change, and which is outside of the scope of this
work)
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86465
See: #4863
Replaces: #4875
Diffstat (limited to 'man/journald.conf.xml')
-rw-r--r-- | man/journald.conf.xml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/man/journald.conf.xml b/man/journald.conf.xml index e4dc5862d9..8974f8f8d5 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -373,6 +373,24 @@ <filename>/dev/console</filename>.</para></listitem> </varlistentry> + <varlistentry> + <term><varname>LineMax=</varname></term> + + <listitem><para>The maximum line length to permit when converting stream logs into record logs. When a systemd + unit's standard output/error are connected to the journal via a stream socket, the data read is split into + individual log records at newline (<literal>\n</literal>, ASCII 10) and NUL characters. If no such delimiter is + read for the specified number of bytes a hard log record boundary is artifically inserted, breaking up overly + long lines into multiple log records. Selecting overly large values increases the possible memory usage of the + Journal daemon for each stream client, as in the worst case the journal daemon needs to buffer the specified + number of bytes in memory before it can flush a new log record to disk. Also note that permitting overly large + line maximum line lengths affects compatibility with traditional log protocols as log records might not fit + anymore into a single <constant>AF_UNIX</constant> or <constant>AF_INET</constant> datagram. Takes a size in + bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, + Gigabytes, or Terabytes (with the base 1024), respectively. Defaults to 48K, which is relatively large but + still small enough so that log records likely fit into network datagrams along with extra room for + metadata. Note that values below 79 are not accepted and will be bumped to 79.</para></listitem> + </varlistentry> + </variablelist> </refsect1> |