Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,19 @@ Configuration
The syslogger application can be used either by configuring the handlers through
application variables, or by using the `logger:add_handler/2` API.

For instance if you want to add two handlers that log to two different syslog
For instance if you want to add an handler that log to local0 syslog
facilities just add this to your sys.config.

{syslogger,
{ident, "myapp"},
{log_opts, [cons, pid, perror]},
{logger, [{handler, user_syslogger, syslogger, #{ facility => user }},
{handler, local0_syslogger, syslogger, #{ facility => local0 }}]
}
}.

This will add two syslogger instances to the Erlang logger that use different facilities.

The same effect could have been achieved by using the logger API like this:
{syslogger, [
{logger, [
{handler, local0_syslogger, syslogger,
#{
config => #{ facility => local0 },
formatter => {logger_formatter, #{single_line => true}}
}}]}]
}.

logger:add_handler(user_syslogger, syslogger, #{ facility => user }),
logger:add_handler(local0_syslogger, syslogger, #{ facility => local0 }).
This will add a syslogger instance to the Erlang

Each syslogger handler can be configured using a map with these configuration options:

Expand Down