Module syslog_logger

The main (backend) server of the syslog application.

Behaviours: gen_server.

This module defines the syslog_logger behaviour.
Required callback functions: hostname/1, hdr/3, msg/3.

See also: syslog_rfc3164, syslog_rfc5424.

Description

The main (backend) server of the syslog application. All logged events will be directed into this process. The process itself is pretty simple, all it does is sending incoming iodata() to the configured destination.

This module also performs the formatting of messages into the configured protocol format. Note that this is completely done in the calling (logging) process and only the formatted binary message is forwarded to the event manager and its handlers. While this may slow down a single logging process, it evenly distributes the formatting load when there are many concurrent loggings.

Protocol backends must implement the syslog_error behaviour.

Function Index

async_log/6 Forwards a message asynchronously.
async_log/7 Forwards a message asynchronously.
log/6 Forwards a message.
log/7 Forwards a message.
set_log_level/1 Change the log level to the given value.
set_log_mode/1 Change the log mode to the given mode.
start_link/0 Starts a registered gen_server.

Function Details

async_log/6

async_log(Severity::syslog:severity(), Pid::syslog:proc_name(), Timestamp::erlang:timestamp(), SD::[syslog:sd_element()], Fmt::io:format() | iolist(), Args::[term()] | no_format) -> ok

Forwards a message asynchronously. This function never fails.

async_log/7

async_log(Severity::syslog:severity(), Pid::syslog:proc_name(), Timestamp::erlang:timestamp(), SD::[syslog:sd_element()], Fmt::io:format() | iolist(), Args::[term()] | no_format, Overrides::proplists:proplist()) -> ok

Forwards a message asynchronously. This function never fails. Allows overriding of config options.

log/6

log(Severity::syslog:severity(), Pid::syslog:proc_name(), Timestamp::erlang:timestamp(), SD::[syslog:sd_element()], Fmt::io:format() | iolist(), Args::[term()] | no_format) -> ok

Forwards a message. This function never fails.

log/7

log(Severity::syslog:severity(), Pid::syslog:proc_name(), Timestamp::erlang:timestamp(), SD::[syslog:sd_element()], Fmt::io:format() | iolist(), Args::[term()] | no_format, Overrides::proplists:proplist()) -> ok

Forwards a message. This function never fails. Allows overriding of config options.

set_log_level/1

set_log_level(Level::syslog:severity()) -> ok | {error, term()}

Change the log level to the given value.

set_log_mode/1

set_log_mode(X1::async | sync | {sync, pos_integer()}) -> ok | {error, term()}

Change the log mode to the given mode.

start_link/0

start_link() -> {ok, pid()} | {error, term()}

Starts a registered gen_server.


Generated by EDoc