def log(self, args):
        app_name, deployment_name = self.parse_app_deployment_name(args.name)
        if not deployment_name:
            deployment_name = 'default'
        last_time = None
        while True:
            logEntries = []
            try:
                logEntries = self.api.read_log(
                    app_name,
                    deployment_name,
                    args.type,
                    last_time=last_time)
            except GoneError:
                raise InputErrorException('WrongApplication')
            if len(logEntries) > 0:
                last_time = datetime.fromtimestamp(float(logEntries[-1]["time"]))
                if args.type == 'worker' and args.wrk_id:
                    logEntries = filter(lambda entry:
                                        entry['wrk_id'] == args.wrk_id, logEntries)
                if args.filter:
                    if args.type in ["error", "worker"]:
                        logEntries = filter(
                            lambda entry: re.search(
                                re.compile(args.filter, re.IGNORECASE),
                                entry['message']),
                            logEntries)
                    if args.type == 'access':
                        logEntries = filter(lambda entry:
                                            re.search(
                                                re.compile(args.filter, re.IGNORECASE),
                                                entry['first_request_line'] +
                                                entry['referer'] +
                                                entry['user_agent'] +
                                                entry['remote_host']),
                                            logEntries)
                print_log_entries(logEntries, args.type)
            time.sleep(2)
Show the log.
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.log