zack-bitcoin/amoveo

Logging

Closed this issue · 1 comments

icook commented

I wanted to open this as a discussion on steps to get the logging to place where other people can manage their own node, and help debug issues easier. I've been investigating a bug in the blockchain synchronization, and in the process have re-written/expanded a lot of the stdout logging messages, as can be seen here. I propose the following steps:

  1. Improve the stdout logging messages to provide context and more details. This will make it easier for people to debug their own problems and understand what the node is doing quickly in the short term.
  2. Convert those calls to use lager, with appropriate logging levels.

For me personally the blocker on converting logging to lager is it's getting flooded with unhandled exceptions during normal operation. Namely:

2018-05-29 15:53:30.610 [debug] <0.871.0> Supervisor testnet_sup started tx_pool_feeder:start_link() at pid <0.25042.2>
2018-05-29 15:53:30.811 [error] <0.25042.2>@accounts:dict_update:23 gen_server tx_pool_feeder terminated with reason: no match of right hand value false in accounts:dict_update/5 line 23
2018-05-29 15:53:30.811 [error] <0.25042.2>@accounts:dict_update:23 CRASH REPORT Process tx_pool_feeder with 0 neighbours exited with reason: no match of right hand value false in accounts:dict_update/5 line 23 in gen_server:terminate/7 line 826
2018-05-29 15:53:30.812 [error] <0.871.0>@accounts:dict_update:23 Supervisor testnet_sup had child tx_pool_feeder started with tx_pool_feeder:start_link() at <0.25042.2> exit with reason no match of right hand value false in accounts:dict_update/5 line 23 in context child_terminated

While syncing this is printed nearly repeatedly, and makes the lager based log nearly impossible to follow. I've tried to fix this problem but my erlang isn't quite strong enough to know the right fix yet.

If step 1 sounds reasonable I will start making pull requests as I improve logging throughout the codebase. I agree with what you said over email that logging to stdout like that is messy, but in the meantime I think it's an improvement, and the changes required here are too extensive to knock out in one go.

What is the issue with syncing? If you can describe the problem, I can fix it right away.
I guess this is from so long ago, it has probably already been fixed.

Logging seems to be working ok already. It isn't clear to me why you want to change it.
Did you ever write code that you wanted to share?