add error logging for log method