handle exceptions in logger