Questions tagged [lager]

Lager (as in the beer) is a logging framework for Erlang. Its purpose is to provide a more traditional way to perform logging in an erlang application that plays nicely with traditional UNIX logging tools like logrotate and syslog.

Lager (as in the beer) is a logging framework for . Its purpose is to provide a more traditional way to perform logging in an erlang application that plays nicely with traditional UNIX logging tools like and .

Features

  • Finer grained log levels (debug, info, notice, warning, error, critical, alert, emergency)
  • Logger calls are transformed using a parse transform to allow capturing of
    Module / Function / Line / Pid information
  • When no handler is consuming a log level (eg. debug) no event is even sent to the log handler
  • Supports multiple backends, including console and file.
  • Rewrites common OTP error messages into more readable messages
  • Support for pretty printing records encountered at compile time
  • Tolerant in the face of large or many log messages, won't out of memory the node
  • Supports internal time and date based rotation, as well as external rotation tools
  • Syslog style log level comparison flags
  • Colored terminal output (requires R16+)

Source: https://github.com/basho/lager

30 questions
7
votes
1 answer

Lager loglevels per application

How can I set different loglevels per application/library in Lager? For example, I would like to see debug messages on the console, but only for my application, not for any libraries I use (eg. amqp_client).
egbokul
  • 3,944
  • 7
  • 36
  • 54
6
votes
2 answers

Lager log line truncated

I'm working on modifying some ejabberd code, and I'm coming across an error printed via lager: 2014-04-25 18:29:39.380 [error] emulator Error in process <0.652.0> on node 'ejabberd@localhost' with exit value:…
kjw0188
  • 3,625
  • 16
  • 28
4
votes
1 answer

How to setup lager on elixir project

I would like to use lager from elixir project. My current mix.exs is following. def application do [erl_opts: [parse_transform: "lager_transform"]] end defp deps do [{:lager, github: "basho/lager"}] end I would like to output log to file by…
tamagohan2
  • 445
  • 4
  • 15
4
votes
1 answer

Lager - Parse Transforms

I have added Lager to my application using rebar. It compiles fine and Lager starts ok when I start my app. However, I get undef messages when I call lager:debug/1 which tells me that the lager_transform parse transformation is not being picked up,…
Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
4
votes
2 answers

Lager calls failing during Common Test test runs

I decided to setup lager in my Erlang project. I am using erlang.mk, so I added ERLC_OPTS = +'{parse_transform, lager_transform}' to my Makefile. I can run make all and compile the modules without errors. I can also start an erl console and run…
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
3
votes
1 answer

How to terminate gen_server gracefully without crash report

In my gen_server I am terminating it like this: handle_info({'EXIT', _From, _Reason}, State) -> {stop, partner_fled, State}; But still logger prints it out as an error 14:56:43.349 [error] gen_server <0.3290.0> terminated with reason:…
t0il3ts0ap
  • 530
  • 4
  • 18
3
votes
0 answers

Erlang app fails to start

When I attempt a _rel/bin/application_name console, I get this: {"Kernel pid terminated",application_controller," {application_start_failure,lager, {bad_return,{{lager_app,start,[normal,[]]}, {'EXIT',{{compile_forms,error},[ …
ombud
  • 199
  • 2
  • 10
3
votes
1 answer

How do you set application variables for a rebar dependency?

I created a project using rebar called "mything". I added lager as a dependency. Now how do I configure lager? I tried adding a "lager" section to "env" in mything.app.src but it doesn't seem to get those settings. I guess I don't know where env…
Matt
  • 84,419
  • 25
  • 57
  • 67
3
votes
1 answer

Lager test logging from the console

Lets say I attach to a running Erlang application and I change the lager configuration from the console, by running: lager:set_loglevel(lager_console_backend,"console.log", debug). I then want to test it by issuing a command…
bryan_basho
  • 159
  • 11
2
votes
2 answers

How to solve collisions between Lager and OTP's Logger in Erlang?

I have an Erlang project in OTP 22 which uses the built-in logger module for logging (which was added in OTP 21). My project uses the dependency "amqp_client" (https://github.com/rabbitmq/rabbitmq-erlang-client). This dependency uses lager library…
J.J.J
  • 21
  • 2
2
votes
0 answers

Is there a means to configure per-module log levels in lager for erlang?

I would like to configure lager so that the default level of info is used for all other modules but I can override certain modules either higher or lower log levels as desired. The following code does not work though I found it in an issue report on…
Robert Simmons Jr.
  • 1,182
  • 8
  • 21
2
votes
0 answers

How to build a release archive with rebar3 together with lager

I am trying to build an OTP release with rebar3. Under the project there are multiple applications. And all those applications will use lager as a logging framework. So I tried the rebar.config like this {erl_opts, [debug_info, {i,…
jnovice
  • 21
  • 1
2
votes
1 answer

Is it possible for lager to output 2 different log file for different application?

I want to write a monitoring application (erlang application). The monitored application and my monitoring application are not both written in erlang and run in the same vm. Now the log is mixed, and I consider to use disk_log in monitoring…
Chen Yu
  • 3,955
  • 1
  • 24
  • 51
1
vote
1 answer

How to set lager.error_logger_hwm in RabbitMQ by rabbitmqctl command

This How to set error_logger_hwm in the new RabbitMQ .conf configuration file format? not suitable for my situation which running rabbitmq(RabbitMQ 3.7.10 on Erlang 20.2.2 -- Ubuntu 16.04) by docker container. I could add advanced.config in the…
Victor Lee
  • 2,467
  • 3
  • 19
  • 37
1
vote
1 answer

Crash Reports are seen on Console but not being logged to Log File

I am seeing Elixir Crash Logs on Console but they are not being logged to the log file. I have tried setting the config: config :logger, handle_otp_reports: true, handle_sasl_reports: true, compile_time_purge_level: :info, backends:…
1
2