Adds an option to log panics via the tracing formatter, so they can be parsed and interpeted by Datadog. If RUST_LOG_FORMAT=json is not set, panics will be pretty-printed directly to standard out, as they have been until now.
This PR:
Makes logging configurable via env var/CLI
Chooses which panic handler to install based on RUST_LOG_FORMAT
Key places to review:
utils/src/logging.rs has the logging setup code and config parameters
deleted utility program count-transactions as the query service now has this functionality
all other changes are just replacing
setup_logging();
setup_backtrace();
with either logging::Config::init (for main binaries, to get the config from the command line) or setup_test
Things tested
demo-native works
manually forcing a panic gives correct output based on the env
git grep setup_logging and git grep setup_backtrace have no results outside the logging utils
I think it would be cleaner to just use the value in RUST_LOG_FORMAT which we have to set to json in order to enable json logging output right now anyways.
Adds an option to log panics via the tracing formatter, so they can be parsed and interpeted by Datadog. If
RUST_LOG_FORMAT=json
is not set, panics will be pretty-printed directly to standard out, as they have been until now.This PR:
RUST_LOG_FORMAT
Key places to review:
utils/src/logging.rs
has the logging setup code and config parameterscount-transactions
as the query service now has this functionalitywith either
logging::Config::init
(for main binaries, to get the config from the command line) orsetup_test
Things tested
git grep setup_logging
andgit grep setup_backtrace
have no results outside the logging utils