write exceptions to log