Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (30 sloc) 1.379 kb
7bcf044 @Vagabond Initial import
Vagabond authored
1 * Overview
2 Lager (pronounced lAAger) is a logging framework for Erlang. Its purpose is
3 to provide a more traditional way to perform logging in an erlang application
4 that plays nicely with traditional UNIX logging tools like logrotate and
5 syslog.
6
7 Features
8 - Finer grained log levels (debug, info, notice, warning, error, critical,
9 alert, emergency)
10 - Logger calls are transformed using a parse transform to allow capturing
11 Module/Function/Line/Pid information
12 - When no handler is consuming a log level (eg. debug) no event is even sent
13 to the log handler
14 - Supports multiple backends, including console, file and syslog.
15
16 * Usage
17 To use lager in your application, you need to define it as a rebar dep or have
18 some other way of including it in erlang's path. You can then add the
19 following option to the erlang compiler flags
20
21 {parse_transform, lager_transform}
22
23 Alternately, you can add it to the module you which to compile with logging
24 enabled:
25
26 -compile([{parse_transform, lager_transform}]).
27
28 Once you have built your code with lager, you can then generate log messages
29 by doing the following:
30
31 lager:error("Some message")
32
33 Or:
34
35 lager:warning("Some message with a term: ~p", [Term])
36
37 The general form is lager:Severity() where Severity is one of the log levels
38 mentioned above.
39
40 * Configuration
41 TODO
Something went wrong with that request. Please try again.