Log exceptions to file