Add possibility to log request/response only when error occurred