Expand description
Native systemd journal submission and field recording.
The module routes formatted messages to the journal socket and records structured tracing fields for journal queries.
StructsΒ§
- Entry
- One entry, submitted when the writer is dropped. Its payload accumulates in the threadβs buffer, which the fields layer opened for this event.
- Fields
- Records the fields of each event and span for the entry the wrapped
console layer is about to write, leaving them queryable with
journalctl F_NAME=value. - Journal
- Datagram connection to the journald submission socket.
- Span
Fields π - Encoded fields of one span, held in its registry extensions.
- Visitor π
ConstantsΒ§
- IDENTIFIER π
- LEN_
PREFIX π - NAME_
MAX π - Journald rejects a longer field name.
- PAYLOAD π
- Entry under construction on this thread, reused across events.
- PAYLOAD_
MAX π - Bounds the datagram well under the default socket send buffer.
- PREFIX π
- Keeps a user field from colliding with one of the journalβs own.
- SOCKET π
FunctionsΒ§
- boundary π
- Steps back to the nearest character boundary at or below
len; a continuation byte never begins a character. - close π
- Seals the message field, trimming the formatterβs trailing whitespace and truncating on a character boundary what the datagram cannot carry.
- enabled π
- Whether events are submitted to journald rather than written to the console, which journald otherwise captures at a single fixed priority.
- extend_
scope π - Appends the fields of every span enclosing the event, innermost first.
- fallback π
- Writes a message the socket would not take to the console, which journald captures in turn under systemd.
- identifier π
- Tags entries with the running executableβs name.
- priority π
- Maps a level onto the syslog severity code journald expects.
- put π
- Appends a length-encoded field, which may carry any byte sequence.
- record_
event π - Opens this threadβs buffer with the eventβs fields and those of the spans enclosing it, for the entry the console writer appends to next.
- record_
span π - Encodes a spanβs fields once, for every event it later encloses.
- record_
values π - Appends the fields of a span recorded after its creation.
- sanitize π
- Journald accepts only uppercase alphanumerics and underscores in a field name, and drops a field whose name it rejects.
Type AliasesΒ§
- Buffer π
- Encoded journal fields; a longer run spills to the heap.
- Code
Line π - Formatted source line number.
- Field
Name π - Journal name of a user field, including the prefix.
- Field
Value π - Value of a user field recorded through its
Debugimplementation. - Identifier π
- Syslog identifier tagging every entry.