make logger more robust