Expand description
A client for the native journal protocol
(https://systemd.io/JOURNAL_NATIVE_PROTOCOL/) and a tracing writer
which forwards the server logs to journald.
Structsยง
- Entry ๐
- A journal entry, encoded for the native protocol.
- Journal ๐
- Writes every log line as one journal entry with the priority derived from the tracing level.
Enumsยง
- Priority ๐
- The syslog priorities used for the
PRIORITYfield. - Wait ๐
- How sending waits for a journal which does not keep up, for example while
it restarts or its disk is slow. The modes use separate sockets, and the
server logs one of their own, see
SERVER_SOCKET.
Constantsยง
- IDENTIFIER ๐
- The SYSLOG_IDENTIFIER of the entries of the server, so that
journalctl -t conmonrsfinds them, and of containers with neither a name nor an ID. - SEND_
BUFFER_ ๐SIZE - The send buffer systemd uses for its journal clients, so that bursts and entries up to that size do not need a memfd.
- SEND_
TIMEOUT ๐ - The longest an attempt of
Wait::Boundedblocks for one entry. - SOCKET_
PATH ๐ - The datagram socket journald receives native protocol entries on.
Staticsยง
- BOUNDED_
SOCKET ๐ - NEVER_
SOCKET ๐ - The sockets of the container output, by mode.
- SERVER_
SOCKET ๐ - The socket of the server logs. Entries take up the send buffer of the socket they got sent on until the journal received them, so container output which the journal does not take fast enough must not fill the one of the server logs, they would be dropped otherwise.
Functionsยง
- create_
memfd ๐ - Create a memfd which allows sealing. Like systemd, ask for a non-executable one first, kernels before 6.3 reject that flag.
- log_
panic_ ๐at - Send the message of a panic to the journal socket at a path, with the
name and the ID of its thread like the default hook, and the location
the
Displayof thePanicHookInfoincludes. The process aborts right after, so the message waits for a journal which does not take it right away, on a socket of its own, as the send buffer of the server logs may be full. Without one, like at the limit of open files, which may be what panicked, it goes to the socket of the server logs without waiting. - log_
panics ๐ - Send the message of every panic to the journal before the default hook
prints it. The release builds abort on a panic, and the forked server
has
/dev/nullas its stderr unless it logs to stdout, so the message would get lost. It bypasses tracing, as its subscriber may be what panicked. - new_
socket ๐ - Create a socket which sends the way the mode tells.
- send_at ๐
- Send an entry of the container output to the journal socket at a path.
- send_
memfd ๐ - Send the data in a sealed memfd, the only kind journald accepts, as
SCM_RIGHTSof an otherwise empty datagram. - send_on ๐
- Send an entry on a socket of the mode, see
new_socket. - send_to ๐
- Send the data as one datagram, or as a memfd if it does not fit.
A signal, like the SIGCHLD of every exited child, interrupts a send which
waits, the kernel does not restart one with a timeout, so it gets retried
until
retry_until, if any. - socket ๐
- The socket kept in
cell, created for the mode on first use. A failed creation is not stored, the next entry tries again. - thread_
name ๐ - The name of the calling thread, without
thread::current, which panics once the local data of the thread is gone, like in a destructor of it while the thread exits. A panic in the hook aborts without any message. The kernel keeps the names of the named threads, at most 15 bytes of them, the others have the one of the thread which started them. The main thread has the name of the process there, it getsmainlike from the default hook. - unavailable ๐
- Whether an error means that there is no journal to send to: no socket file, or no one listening on it.