Improved logging for debugging hanging processes