Improve logging configuration and testing
Fix failsafe configuration
Improve shutdown handler testing