README.org
1* Overview
2 [[http://travis-ci.org/basho/lager_syslog][Travis-CI]] :: [[https://secure.travis-ci.org/basho/lager_syslog.png]]
3
4 This is a syslog backend for [[https://github.com/basho/lager][Lager]]. It
5 allows you to send messages out of lager and into the local syslog daemon.
6
7* Configuration
8 Configure a Lager handler like the following:
9
10#+BEGIN_EXAMPLE
11 {lager_syslog_backend, [Identity, Facility, Level]}
12#+END_EXAMPLE
13
14 The Identity is the string to tag all messages with in syslog, usually the
15 application's name. The facility is the facility to log to (see the syslog
16 documentation for a list of these). The Level is the lager level at which the
17 backend accepts messages (eg. using 'info' would send all messages at info
18 level or above into syslog). While you can filter messages at the syslog
19 level, it will improve performance if you filter in lager instead.
20
21 An example for [[http://www.basho.com/products_riak_overview.php][riak]]
22 would look something like this:
23
24#+BEGIN_EXAMPLE
25 {handlers, [
26 {lager_syslog_backend, ["riak", local1, info]},
27 ] },
28#+END_EXAMPLE
29
30 Then in your syslog config remembering syslog likes tabs and not spaces:
31
32#+BEGIN_EXAMPLE
33 local1.info /var/log/riak_info.log
34#+END_EXAMPLE
35
36 If you want to log to multiple facilities at once, you can do something like
37 the following:
38
39#+BEGIN_EXAMPLE
40 {{lager_syslog_backend, "daemon facility"}, ["riak1", daemon, info]},
41 {{lager_syslog_backend, ftp}, ["riak2", ftp, notice]},
42#+END_EXAMPLE
43
44 You MUST give each instance of the file backend its own identifier.
45
46 Refer to Lager's documentation for futher information on configuring handlers.
47
48* Troubleshooting
49 There's not a lot to go wrong, but if you are not receiving messages, check
50 your syslog config and read its manpage for more information. OS X, in
51 particular, has a very strange default config where it drops messages below
52 the 'info' level by default.
53
54