Changing lager console backend log level

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing lager console backend log level

Devangana Tarafdar
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 '[hidden email]'
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@atxload01a 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)

([hidden email])1>  application:start(compiler),application:start(syntax_tools),application:start(goldrush),application:start(lager).
ok
([hidden email])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

([hidden email])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"}]
([hidden email])4>


Thanks !

Devangana


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Changing lager console backend log level

Chris Waymire
Just taking a quick look it does not appear that lager_console_backend supports that argument style in 3.4.0


Try {lager_console_backend, [info]}

On Fri, Oct 13, 2017 at 7:09 AM, Devangana Tarafdar <[hidden email]> 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 '[hidden email]'
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@atxload01a 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)

([hidden email])1>  application:start(compiler),application:start(syntax_tools),application:start(goldrush),application:start(lager).
ok
([hidden email])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

([hidden email])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"}]
([hidden email])4>


Thanks !

Devangana


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Changing lager console backend log level

Devangana Tarafdar
Thank you for that suggestion,  I will try that.

On Oct 14, 2017 2:15 PM, "Chris Waymire" <[hidden email]> wrote:
Just taking a quick look it does not appear that lager_console_backend supports that argument style in 3.4.0


Try {lager_console_backend, [info]}

On Fri, Oct 13, 2017 at 7:09 AM, Devangana Tarafdar <[hidden email]> 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 '[hidden email]'
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@atxload01a 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)

([hidden email])1>  application:start(compiler),application:start(syntax_tools),application:start(goldrush),application:start(lager).
ok
([hidden email])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

([hidden email])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"}]
([hidden email])4>


Thanks !

Devangana


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Changing lager console backend log level

Devangana Tarafdar
That worked, thank you !

-Devangana

On Sun, Oct 15, 2017 at 12:52 PM, Devangana Tarafdar <[hidden email]> wrote:
Thank you for that suggestion,  I will try that.

On Oct 14, 2017 2:15 PM, "Chris Waymire" <[hidden email]> wrote:
Just taking a quick look it does not appear that lager_console_backend supports that argument style in 3.4.0


Try {lager_console_backend, [info]}

On Fri, Oct 13, 2017 at 7:09 AM, Devangana Tarafdar <[hidden email]> 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 '[hidden email]'
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@atxload01a 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)

([hidden email])1>  application:start(compiler),application:start(syntax_tools),application:start(goldrush),application:start(lager).
ok
([hidden email])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

([hidden email])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"}]
([hidden email])4>


Thanks !

Devangana


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions