For logging activity of an Erlang/OTP application, do you simply use a wrapper over disk_log
or some other libraries?
Asked
Active
Viewed 6,506 times
19

Alexey Romanov
- 167,066
- 35
- 309
- 487
-
1A good note on performance when using `disk_log` can be found here (summary: `disk_log` is really fast!): http://timanovsky.wordpress.com/2009/02/04/correct-implementation-of-fast-server-logging-in-erlang/ – Adam Lindberg Mar 02 '11 at 14:33
5 Answers
11
There is standard error logging application SASL http://www.erlang.org/doc/system_principles/error_logging.html.
It can be configured to save logs on disk.
error_logger:info_report example usage:
2> error_logger:info_report([{tag1,data1},a_term,{tag2,data}]).
=INFO REPORT==== 11-Aug-2005::13:55:09 ===
tag1: data1
a_term
tag2: data
ok
3> error_logger:info_report("Something strange happened").
=INFO REPORT==== 11-Aug-2005::13:55:36 ===
Something strange happened
ok
Also there is log4erl when you need different log format. You can look for real usage of it in erlyvideo project.

lest
- 7,780
- 2
- 24
- 22
-
I thought it was only intended for logging errors: processes dying, etc. Not for the human-readable logs. – Alexey Romanov Sep 15 '10 at 18:27
-
1There is error_logger:info_report function that is useful for outputting your custom data. – lest Sep 15 '10 at 21:28
4
Two libraries I've found: http://code.google.com/p/erlslug/ and http://github.com/ahmednawras/log4erl

Alexey Romanov
- 167,066
- 35
- 309
- 487