Closed egorovd closed 6 years ago
Hi. I think I remember reading in the OTP 21 release notes that error logger is not started by default any more, so perhaps that is the cause of the crash. Try telling lager not to install an error logger handler by setting the handler to false as in the documentation.
Yes, you are absolutely right. After adding to the config, the error does not appear. Thank you. More on this topic: http://erlang.org/documentation/doc-10.0-rc1/lib/kernel-6.0/doc/html/error_logger.html Thanks again.
Sure. Thanks for the ticket.
Erlang/OTP 20 [erts-9.3.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Use lager 3.6.3
Error reading =CRASH REPORT==== 4-Jul-2018::14:36:13.210994 ===
crasher:
initial call: lager_handler_watcher:init/1
pid: <0.92.0>
registered_name: []
exception exit: noproc
in function gen:do_for_proc/2 (gen.erl, line 228)
in call from gen_event:rpc/2 (gen_event.erl, line 239)
in call from lager_handler_watcher:install_handler2/3 (src/lager_handler_watcher.erl, line 117)
in call from lager_handler_watcher:init/1 (src/lager_handler_watcher.erl, line 51)
in call from gen_server:init_it/2 (gen_server.erl, line 374)
in call from gen_server:init_it/6 (gen_server.erl, line 342)
ancestors: [lager_handler_watcher_sup,lager_sup,<0.84.0>]
message_queue_len: 0
messages: []
links: [<0.87.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 610
stack_size: 27
reductions: 234
neighbours:
{lager,
[{error_logger_hwm,1000},
{error_logger_redirect,true},
{log_dir,"log"},
{handlers,
[{lager_console_backend,[debug]},
{lager_file_backend,
[{file,"log/error.log"},
{level,error},
{size,510485760},
{date,"$D0"},
{count,5}]}]},
{extra_sinks,
[{error_logger_lager_event,
[handlers,
[{lager_console_backend,[debug]},
{lager_file_backend,
[{file,"log/error.log"},
{level,error},
{size,510485760},
{date,"$D0"},
{count,5}]}]]}]},
{crash_log,"log/crash.log"}]}
I config lager like you had said, but error occurs, why ?
It seems like you didn't start lager before sending a log message.
I've got this same issue with OTP 22:
=CRASH REPORT==== 29-Dec-2018::17:05:34.093061 === crasher: initial call: lager_handler_watcher:init/1 pid: <0.199.0> registered_name: [] exception exit: noproc in function gen:do_for_proc/2 (gen.erl, line 228) in call from gen_event:rpc/2 (gen_event.erl, line 239) in call from lager_handler_watcher:install_handler2/3 (/Users/oladipo/Projects/Erlang/veritab/macrelease/_build/default/lib/lager/src/lager_handler_watcher.erl, line 117) in call from lager_handler_watcher:init/1 (/Users/oladipo/Projects/Erlang/veritab/macrelease/_build/default/lib/lager/src/lager_handler_watcher.erl, line 51) in call from gen_server:init_it/2 (gen_server.erl, line 374) in call from gen_server:init_it/6 (gen_server.erl, line 342) ancestors: [lager_handler_watcher_sup,lager_sup,<0.184.0>] message_queue_len: 0 messages: [] links: [<0.187.0>] dictionary: [] trap_exit: false status: running heap_size: 987 stack_size: 27 reductions: 266 neighbours:
How exactly is this supposed to be resolved?
I'm having the same issue with 22 and I can't fix it.
I have
{lager, [
{log_root, "./log"},
{handlers, [
{lager_console_backend, [{level, info}]},
{lager_file_backend, [{file, "error.log"}, {level, error}]},
{lager_file_backend, [{file, "console.log"}, {level, info}]}
]},
{error_logger_redirect, true}
]}
I tried both {error_logger_redirect, true}
and {error_logger_redirect, false}
....which does nothing, and even if I make sure lager starts first, I still the the same noproc that @oladipo gets.
Hello. ) Today I updated the lager. And after running app, into the console I saw:
Env config:
What additional information will help to identify the problem?
Thank you.