use logError and atomic logging statement.