Block all signals in new threads and children processes. That should avoid deadlocks when signal is caught inside logger call or inside fork.