Added option to log error messages in the opt path.