def _get_last_error_log(self, command_str):
        logpath = re.search(r'--logpath ([^\s]+)', command_str)
        loglines = ''
        try:
            with open(logpath.group(1), 'rb') as logfile:
                for line in logfile:
                    if not line.startswith('----- BEGIN BACKTRACE -----'):
                        loglines += line
                    else:
                        break
        except IOError:
            pass
        return loglines