Includes logging improvements by Vasil Dimov and John Newbery.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/22387 | core#22387]] [4/5]
https://github.com/bitcoin/bitcoin/pull/22387/commits/f424d601e1b6870e20bc60f5ccba36d2e210377b
Depends on D10938