Erlang 'basho / lager' log app, is it possible to configure the module log level?

There is one file in rabbitmq source code, name it "rabbit_log.erl". It can configure various levels of module logs. Setup is performed by the application environment.

for example in a .erlang file:

 application:set_env(rabbit,log_levels, [{default,info},{aaa_connection,error}]). 

Only the aaa_connection module will show the error level, and the information level module will appear on the other module.

I want to know that it is possible to configure the module log level in a basho/lager application?

+4
source share
1 answer

You can use the lager trace function ( https://github.com/basho/lager#tracing ).

 lager:trace_file("log/aaa_connection_error.log", [{module, aaa_connection}], error) 
+5
source

Source: https://habr.com/ru/post/1482790/


All Articles