feat(logging): always-on startup logging #207
feat(logging): always-on startup logging #207EddieHouston wants to merge 1 commit intoBlockstream:new-indexfrom
Conversation
98d05f0 to
b0ff950
Compare
b0ff950 to
b4ddcf2
Compare
…igured verbosity after Electrs has been observed starting, running for a few minutes, then dying silently in environments with no verbosity flags set. With the default verbosity (error-only), there is zero diagnostic output during startup. Initialize stderrlog at info level minimum during startup so key lifecycle milestones are always visible (daemon connection, DB open, sync progress, mempool load, server ready). After startup completes, log level drops to the user's configured verbosity via log::set_max_level(). Also promotes a handful of debug!() calls in schema.rs and mempool.rs to info!() so they fire during the startup window.
b4ddcf2 to
efe5c7a
Compare
| let metrics = Metrics::new(config.monitoring_addr); | ||
| metrics.start(); | ||
|
|
||
| info!("starting electrs"); |
There was a problem hiding this comment.
log that we are starting with info log level set something like. "starting electrs with INFO log level during startup"
| Arc::clone(&salt_rwlock), | ||
| ); | ||
|
|
||
| info!("startup complete, switching to configured log verbosity"); |
There was a problem hiding this comment.
print the configured log verbosity here
|
let's wait until we see before we revert verbosity. it's only at this point that electrs is ready
this is what it should show:
|
|
I would consider a different approach: make level 2 logging ( I don't think it's really ever desirable to hide Changing the meaning of |
Summary
running with no
-vflag (error-only logging), making it impossible todiagnose where they got stuck
drops to the user's configured verbosity after servers are listening
info!milestone logs at each startup phase: daemon connection,DB open, initial sync start/complete, mempool load, startup complete
debug!logs inschema.rsandmempool.rstoinfo!so block/header/mempool counts are visible during the startup window
Test plan
-vflag — verify startup milestones arelogged and logging goes silent after "startup complete"
-vvv— verify behavior is unchanged (alreadyabove the info threshold)
which phase it was in