Module journald_log

Tiny interface to Journald socket.

Description

Tiny interface to Journald socket

See man sd_journal_sendv, man systemd.journal-fields

See sd_journal_sendv implementation.

Data Types

handle()

abstract datatype: handle()

key()

key() = iodata()

log_msg()

log_msg() = #{key() => value()} | [{key(), value()}]

value()

value() = iodata() | integer() | atom()

Function Index

close/1Closes journald log socket.
format/1Formats a flat Key-Value message to a (non-documented) format acceptable by journald socket.
log/2Logs a Key - Value message to journald socket.
open/1Opens journald log socket.

Function Details

close/1

close(State::handle()) -> ok

Closes journald log socket

format/1

format(Map::log_msg()) -> iodata()

Formats a flat Key-Value message to a (non-documented) format acceptable by journald socket

log/2

log(KV::log_msg(), State::handle()) -> ok | {error, inet:posix()}

Logs a Key - Value message to journald socket

Keys have to be iodata() and should not contain newlines or = signs. Values can be iodata(), atom() or integer() and may contain any binaries. utf8 is preferrable

open/1

open(Opts::#{socket_path => file:filename_all()}) -> handle()

Opens journald log socket


Generated by EDoc