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
1
vote
1 answer

where is code beam file?

I have printed all code loaded as follows, why {lager_default_tracer,[]}, where beam file? (lager_test_1@macbook.local)10> io:format("~p",[code:all_loaded()]). [{io,"/usr/local/lib/erlang/lib/stdlib-2.3/ebin/io.beam"}, …
Chen Yu
  • 3,955
  • 1
  • 24
  • 51
1
vote
0 answers

error happen, when using lager's trace?

when using lager's 'trace' as…
Chen Yu
  • 3,955
  • 1
  • 24
  • 51
1
vote
1 answer

How to only log when in debug mode using erlang-lager?

In Java Development, we did debug checking before logging a time / memory consuming operation. for example: if(log.isDebugEnabled()){ log.debug("This is time / memory consuming {}", bigString); } with Erlang Lager, Do I need to do the same check…
user3644708
  • 2,466
  • 2
  • 16
  • 32
1
vote
1 answer

How does ~1024p get into my lager logs sometimes?

I'm using lager in an erlang app, and I occasionally have log statements like the following: ?log_error("failed to create reward instance: ~1024p", Reason) where Reason was returned from a previous function call. As I understand it ~1024p should be…
streetcornerlurker
  • 501
  • 1
  • 7
  • 14
1
vote
2 answers

Including lager in an erlang.mk project

I'm trying to add lager to a simple erlang.mk project. I understand lager uses parse transforms, so you have to set compile flags accordingly; so following advice from here: Lager calls failing during Common Test test runs my Makefile looks as…
Justin
  • 4,649
  • 6
  • 33
  • 71
1
vote
1 answer

Chicagoboss make error for lager

I am porting my web application developed in Chicagoboss from my mac to ubuntu. But when I run make on ubuntu I get the following error: ERROR: pre_compile failed while processing /home/myname/myapp_priv: {'EXIT',{undef,[{lager,start,[],[]}, …
raich
  • 127
  • 1
  • 8
1
vote
1 answer

Change default datetime format in Basho lager

I am implementing lager in my erlang application and was wondering if there was a way to configure the datetime format used? I'd like to default to ISO 8601.
RockyMountainHigh
  • 2,871
  • 5
  • 34
  • 68
0
votes
1 answer

Lager multiple sinks for different sub-applications

So what i am trying to do is this: Whenever a module calls ?DEBUG() OR ?INFO() OR ?WARNING() ETC (DEBUG, INFO, WARNING are macros defined as APPNAME:debug/APPNAME:info/APPNAME:warning ETC respectively) and APPNAME is also another macro which is…
SilverBlaZe
  • 85
  • 1
  • 5
0
votes
1 answer

Can two separate lager sinks log in to same file?

So I am using lager for logging and trying to achieve a particular scenario here Currently we have single lager sink for our erlang project which has multiple apps and now we want per-app lager sink, but we don't want to break the logs into multiple…
SilverBlaZe
  • 85
  • 1
  • 5
0
votes
0 answers

RabbitMQ Container Configurations Error error:badarg

I am running Rabbitmq from Docker image. this is the Dockerfile FROM rabbitmq:3-management RUN rabbitmq-plugins enable --offline rabbitmq_mqtt rabbitmq_peer_discovery_k8s rabbitmq_stomp rabbitmq_management COPY rabbitmq.conf…
Meto
  • 420
  • 2
  • 7
  • 17
0
votes
1 answer

how to rotate log file with date in filename (ex: debug.log.2019-04-24) in erlang lager

I used the lagger lager_file_backend setting: {lager_file_backend, [{file, "debug.log"}, {level, debug}, {size, 10485760}, {date, "$D0"}, {count, 30}, {formatter_config, [date, " ", time, " ", pid, " ", module, ":", line, " [",…
yaocl
  • 101
  • 2
  • 10
0
votes
1 answer

error while compiling a new custom module in ejabberd

I am trying to compile a custom module and continuously getting this error `undefined parse transform 'lager_transform'` I tried almost all the suggestions regarding this error but could not come across anything. I am using ejabberd-18.01 and otp…
Prakash
  • 396
  • 1
  • 6
  • 23
0
votes
1 answer

ejabberd odbc error + unable to figure out exact source

my ejabberd server is constantly crashing and it is somewhat related to ODBC module but I am not able to understand the issue. Below are the logs. Can anyone help me interpret? I have copy pasted a few messages below. =ERROR REPORT====…
trevize
  • 11
  • 1
0
votes
2 answers

Cowboy on Erlang crashes on shutdown

I'm getting a lot of errors on shutdown of my Erlang vm related to my cowboy handlers. I've got a simple_one_for_one supervisor running a start_listeners() function that runs cowboy:start_http(). Everything starts, no errors, handles requests…
Matt
  • 207
  • 1
  • 7
0
votes
1 answer

calling an erlang application started on another module

I am trying to use "Lager" ( a logger application ). Lager was started from a main application module "A" Following is how lager was specified in the .app file: {application, myapp, [ {description, ""}, {vsn, "1"}, {registered, []}, …
gextra
  • 8,439
  • 8
  • 40
  • 62
1
2