write exceptions in log