stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Ability to get logs by "topic"

Open lgalabru opened this issue 5 years ago • 6 comments

As of today, when debugging, we only have the options to get INFO/WARN/ERRO or DEBUG/INFO/WARN/ERRO. When enabling DEBUG logs, we're producing gigabytes of logs per hour which is a bit cumbersome. It would be useful to tag our logs with some kind of topic and be able to select some of them at runtime, with something like STACKS_LOG_TOPIC=atlas,pox,bitcoin,net,http,clarity,etc.

lgalabru avatar Feb 24 '21 21:02 lgalabru

even better if this was dynamic and did not require a restart, but filtering would be nice already!

psq avatar Feb 24 '21 21:02 psq

Don't we already have this -- i.e. look at the log message's file name?

jcnelson avatar Feb 24 '21 21:02 jcnelson

Don't we already have this -- i.e. look at the log message's file name?

I think that would be a pretty painful alternative: I may be interested in something like "debug logs and above for pox and atlas", "warn and above for net", and "info for everything else" and topic logging models usually allow you to do something like that. Grepping log outputs for something like that would be painful.

The other nice thing is that in many cases this allows the stacks-node to never produce the logging information at all. Debug logs on net and marf (marf in particular), are really really long, and trace logs on marf even add pretty costly computation. Support for topics would have the benefit that it could alleviate load on log aggregation and the stacks-node itself.

Fortunately, the logging framework we use already has a lot of support for this kind of thing -- we'd just need to construct multiple "logger" objects and make them available to logging sites as we update them.

kantai avatar Feb 24 '21 21:02 kantai

Closing criteria for this issue:

  • Get a PR merged that updates our logging macros to accept topics
  • Start using them

jcnelson avatar Mar 01 '21 16:03 jcnelson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 29 '21 13:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 02:09 stale[bot]

This issue has been automatically closed. Please reopen if needed.

stale[bot] avatar Oct 22 '22 20:10 stale[bot]