Module ejournald

Behaviours: application.

Data Types

datetime1970()

datetime1970() = calendar:datetime1970()

direction()

direction() = ascending | descending

erl_opts()

erl_opts() = erlang_node | application | code_file | function

id()

id() = term() | pid()

io_options()

io_options() = {name, string()} | {log_level, log_level()} | {level_prefix, string()}

log_data()

log_data() = string() | [string()]

depends on the 'message' option

log_level()

log_level() = emergency | alert | critical | error | warning | notice | info | debug

log_message()

log_message() = {datetime1970(), log_level(), log_data()} | {'EXIT', pid(), atom()} | journal_invalidate

log_options()

log_options() = {direction, direction()} | {since, datetime1970()} | {until, datetime1970()} | {at_most, integer()} | {log_level, log_level()} | {message, boolean()} | {regex, iodata()} | {erl_opts(), atom()}

notify_options()

notify_options() = {message, boolean()} | {regex, iodata()} | {log_level, log_level()} | {dir, list()} | {erl_opts(), atom()}

reader_options()

reader_options() = {dir, string()}

sink()

sink() = pid() | sink_fun()

sink_fun()

sink_fun() = fun((log_message()) -> any())

Function Index

get_logs/1Get logs from default reader.
get_logs/2Get logs from a named reader.
log_notify/2Starts a worker that monitors the journal and filters new entries.
start/2Application behaviour callback.
start_io/1Start the default I/O-server named ejournald_io_server and identified by the name "ejournald_io_server" for journald.
start_io/2Start an I/O-server with own options.
start_reader/1Start an unnamed reader.
start_reader/2Start a named reader.
stop/1Application behaviour callback.
stop_io/1Stop an I/O-server with its name or pid.
stop_log_notify/1Stops the worker.
stop_reader/1Stop a reader by its name or pid.

Function Details

get_logs/1

get_logs(Options::[log_options()]) -> [log_message()] | {error, any()}

Get logs from default reader. See get_logs/2.

get_logs/2

get_logs(Id::id(), Options::[log_options()]) -> [log_message()] | {error, any()}

Get logs from a named reader.

log_notify/2

log_notify(Sink::sink(), Options::[notify_options()]) -> {ok, pid()} | {error, any()}

Starts a worker that monitors the journal and filters new entries. Note that the message 'journal_invalidate' means that "journal files were added or removed (possibly due to rotation)" according to the systemd documentation. Thus you should e.g. refresh your monitors.

start/2

start(Type, Args) -> any()

Application behaviour callback.

start_io/1

start_io(Options::[io_options()]) -> {ok, pid()} | {error, any()}

Start the default I/O-server named ejournald_io_server and identified by the name "ejournald_io_server" for journald.

start_io/2

start_io(Name::term(), Options::[io_options()]) -> {ok, pid()} | {error, any()}

Start an I/O-server with own options. The 'name' option is mandatory and used in journald logs.

start_reader/1

start_reader(Options::[reader_options()]) -> {ok, pid()} | {error, any()}

Start an unnamed reader.

start_reader/2

start_reader(Name::term(), Options::[reader_options()]) -> {ok, pid()} | {error, any()}

Start a named reader.

stop/1

stop(State) -> any()

Application behaviour callback.

stop_io/1

stop_io(Id::term()) -> ok | {error, any()}

Stop an I/O-server with its name or pid.

stop_log_notify/1

stop_log_notify(Pid::pid()) -> ok | {error, any()}

Stops the worker.

stop_reader/1

stop_reader(Id::term()) -> ok | {error, any()}

Stop a reader by its name or pid.


Generated by EDoc