[erlang-questions] Changing lager console backend log level

Devangana Tarafdar devangana@REDACTED
Sun Oct 15 19:52:53 CEST 2017


Thank you for that suggestion,  I will try that.

On Oct 14, 2017 2:15 PM, "Chris Waymire" <chris@REDACTED> wrote:

> Just taking a quick look it does not appear that lager_console_backend
> supports that argument style in 3.4.0
>
> https://github.com/erlang-lager/lager/blob/3.4.0/src/
> lager_console_backend.erl
>
> Try {lager_console_backend, [info]}
>
> On Fri, Oct 13, 2017 at 7:09 AM, Devangana Tarafdar <devangana@REDACTED>
> wrote:
>
>> Hello,
>>
>> I am having an issue with lager (3.4.0) and am wondering if anyone can
>> point out if I am doing something wrong:
>>
>> Basically I want to change the log level for the console backend from the
>> app config file.
>>
>> I am starting lager with the following inserted in the config file:
>>
>>   {lager,[
>>             {error_logger_whitelist,[yaws_log_file_h]},
>>             {handlers, [
>>                {lager_file_backend, [{file,"/tmp/lager_test.info"}
>> ,{level,debug}]},
>>
>>                 {lager_console_backend, [{level,info}]}
>>            ]},
>>
>>             {log_root, "/tmp"}
>>
>>           ]},
>>
>> Is the above syntax for lager_console_backend  correct ?  Lager seems to
>> be having some problem with the console backend handler. I see this in the
>> log file:
>>
>>
>> 2017-10-12 15:34:33.405 [error] <0.60.0>@lager_handler_watcher:123 Lager
>> fatally failed to install handler lager_console_backend into lager_event,
>> NOT retrying: bad_log_level
>>
>> 2017-10-12 15:34:33.405 [debug] <0.62.0>@lager_handler_watcher:119 Lager
>> installed handler error_logger_lager_h into error_logger
>> 2017-10-12 15:34:33.435 [debug] <0.47.0> Supervisor gr_param_sup started
>> gr_param:start_link(gr_lager_default_tracer_params) at pid <0.64.0>
>> 2017-10-12 15:34:33.435 [debug] <0.46.0> Supervisor gr_counter_sup
>> started gr_counter:start_link(gr_lager_default_tracer_counters) at pid
>> <0.65.0>
>> 2017-10-12 15:34:33.439 [debug] <0.48.0> Supervisor gr_manager_sup
>> started gr_manager:start_link(gr_lager_default_tracer_params_mgr,
>> gr_lager_default_tracer_params, []) at pid <0.66.0>
>> 2017-10-12 15:34:33.439 [debug] <0.48.0> Supervisor gr_manager_sup
>> started gr_manager:start_link(gr_lager_default_tracer_counters_mgr,
>> gr_lager_default_tracer_counters, [{input,0},{filter,0},{output,
>> 0},{job_input,0},{job_run,0},{job_time,0},{job_error,0}]) at pid <0.67.0>
>> 2017-10-12 15:34:33.633 [info] <0.7.0> Application lager started on node '
>> d@REDACTED <d@REDACTED>'
>> 2017-10-12 15:34:33.888 [debug] <0.56.0>@lager_handler_watcher:119 Lager
>> installed handler lager_backend_throttle into lager_event
>>
>> I am starting up my tiny test environment as follows:
>>
>> [dtaraf@REDACTED lager_test_rel-1.0.0]$ erl -name d -setcookie x
>> -config /usr/pkg/otp/rel/lager_test_rel-1.0.0/lager_test_rel.config -pz
>> /usr/pkg/otp/lib/lager-3.4.0/ebin -pz /usr/pkg/otp/lib/goldrush-0.1.
>> 9/ebin
>>
>> *Erlang/OTP 17* [erts-6.3] [source] [64-bit] [async-threads:10]
>> [kernel-poll:false]
>>
>> Eshell V6.3  (abort with ^G)
>>
>> (d@REDACTED)1>  application:start(compiler),ap
>> plication:start(syntax_tools),application:start(goldrush),ap
>> plication:start(lager).
>> ok
>> (d@REDACTED)2>  lager:status().
>> Lager status:
>> File /tmp/lager_test.info (lager_event) at level debug
>> Console (lager_event) at level {error,bad_module}
>> Active Traces:
>> Tracing Reductions:
>> Tracing Statistics:
>>   input: 0
>>  output: 0
>>  filter: 0
>> ok
>>
>> (d@REDACTED)3> application:which_applications().
>> [*{lager,"Erlang logging framework","3.4.0*"},
>>  {goldrush,"Erlang event stream processor","0.1.9"},
>>  {syntax_tools,"Syntax tools","1.6.17"},
>>  {compiler,"ERTS  CXC 138 10","5.0.3"},
>>  {stdlib,"ERTS  CXC 138 10","2.3"},
>>  {kernel,"ERTS  CXC 138 10","3.1"}]
>> (d@REDACTED)4>
>>
>>
>> Thanks !
>>
>> Devangana
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171015/4c4ffd73/attachment.htm>


More information about the erlang-questions mailing list