Skip to main content

Module journal

Module journal 

Source
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 PRIORITY field.
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 conmonrs finds 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::Bounded blocks 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 Display of the PanicHookInfo includes. 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/null as 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_RIGHTS of 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 gets main like 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.