logging exception to error