Get the logs via http.
548024
@Override
  public void doGet(HttpServletRequest request, 
                    HttpServletResponse response
                    ) throws ServletException, IOException {
    long start = 0;
    long end = -1;
    boolean plainText = false;
    TaskLog.LogName filter = null;
    boolean isCleanup = false;

    String taskIdStr = request.getParameter("taskid");
    if (taskIdStr == null) {
      response.sendError(HttpServletResponse.SC_BAD_REQUEST, 
                         "Argument taskid is required");
      return;
    }
    TaskAttemptID taskId = TaskAttemptID.forName(taskIdStr);
    String logFilter = request.getParameter("filter");
    if (logFilter != null) {
      try {
        filter = TaskLog.LogName.valueOf(TaskLog.LogName.class, 
                                         logFilter.toUpperCase());
      } catch (IllegalArgumentException iae) {
        response.sendError(HttpServletResponse.SC_BAD_REQUEST,
                           "Illegal value for filter: " + logFilter);
        return;
      }
    }
    
    String stackTracing = request.getParameter("stacktracing");
    if (stackTracing != null) {
      ServletContext application = this.getServletConfig().getServletContext();
      TaskTracker tt = (TaskTracker)application.getAttribute("task.tracker");
      
      String pid = request.getParameter("pid");
      if (pid == null) {
        tt.doStackTrace(taskId);
      } else {
        tt.doStackTrace(pid);
      }
      
      try {
        Thread.sleep(3000);
      } catch (InterruptedException e) {
        
      }
    }
    
    String sLogOff = request.getParameter("start");
    if (sLogOff != null) {
      start = Long.valueOf(sLogOff).longValue();
    }
    
    String sLogEnd = request.getParameter("end");
    if (sLogEnd != null) {
      end = Long.valueOf(sLogEnd).longValue();
    }
    
    String sPlainText = request.getParameter("plaintext");
    if (sPlainText != null) {
      plainText = Boolean.valueOf(sPlainText);
    }
    
    String sCleanup = request.getParameter("cleanup");
    if (sCleanup != null) {
      isCleanup = Boolean.valueOf(sCleanup);
    }
    
    response.setContentType("text/html");
    OutputStream out = response.getOutputStream();
    if( !plainText ) {
      out.write(("<html>\n" +
                 "<title>Task Logs: '" + taskId + "'</title>\n" +
                 "<body>\n" +
                 "<h1>Task Logs: '" +  taskId +  "'</h1><br>\n").getBytes()); 

      if (filter == null) {
        printTaskLog(response, out, taskId, start, end, plainText, 
                     TaskLog.LogName.STDOUT, isCleanup);
        printTaskLog(response, out, taskId, start, end, plainText, 
                     TaskLog.LogName.STDERR, isCleanup);
        printTaskLog(response, out, taskId, start, end, plainText, 
                     TaskLog.LogName.SYSLOG, isCleanup);
        if (haveTaskLog(taskId, TaskLog.LogName.DEBUGOUT)) {
          printTaskLog(response, out, taskId, start, end, plainText, 
                       TaskLog.LogName.DEBUGOUT, isCleanup);
        }
        if (haveTaskLog(taskId, TaskLog.LogName.PROFILE)) {
          printTaskLog(response, out, taskId, start, end, plainText, 
                       TaskLog.LogName.PROFILE, isCleanup);
        }
      } else {
        printTaskLog(response, out, taskId, start, end, plainText, filter,
                     isCleanup);
      }
      
      out.write("</body></html>\n".getBytes());
      out.close();
    } else if (filter == null) {
      response.sendError(HttpServletResponse.SC_BAD_REQUEST,
          "You must supply a value for `filter' (STDOUT, STDERR, or SYSLOG) if you set plainText = true");
    } else {
      printTaskLog(response, out, taskId, start, end, plainText, filter, 
                   isCleanup);
    } 
  }
870755
function fetchLogs(root, msg, callback) {
    const number = msg.number;
    const logfile = msg.logfile;
    const serverId = msg.serverId;
    const filePath = path.join(root, getLogFileName(logfile, serverId));

    const endLogs = [];
    exec(`tail -n ${number} ${filePath}`, (error, output) => {
        const endOut = [];
        output = output.replace(/^\s+|\s+$/g, '').split(/\s+/);

        for (let i = 5; i < output.length; i += 6) {
            endOut.push(output[i]);
        }

        const endLength = endOut.length;
        for (let j = 0; j < endLength; j++) {
            const map = {};
            let json;
            try {
                json = JSON.parse(endOut[j]);
            } catch (e) {
                logger.error(`the log cannot parsed to json, ${e}`);
                continue;   // eslint-disable-line
            }
            map.time = json.time;
            map.route = json.route || json.service;
            map.serverId = serverId;
            map.timeUsed = json.timeUsed;
            map.params = endOut[j];
            endLogs.push(map);
        }

        callback({ logfile: logfile, dataArray: endLogs });
    });
}
758017
public function getLogs(){
        $rest = $this->getService( self::API_VPN_CLIENT_LOGS);
        $rest->GET();

        return $rest->getResult();
    }
905043
def get_logs(self, jobs, log_file=None):
        """"""
        if not (jobs and self.log_url):
            return

        for job in jobs:
            url = "{}?jobId={}".format(self.log_url, job.get("id"))
            if log_file:
                self._download_log("{}&download".format(url), log_file)
            else:
                logger.info("Submit log for job %s: %s", job.get("id"), url)
495204
private function readLogs(): array
	{
		$logs = [];
		$dir = @dir($this->path);
		if (!$dir) {
			throw new IOException("getLogs: Failed opening directory '$this->path' for reading");
		}
		while ($file = $dir->read()) {
			if ($file == '.' || $file == '..' || $file == 'web.config' || $file == '.htaccess') {
				continue;
			} else {
				$hash = $this->hasher->hash($file);
				$logs[$hash] = new Log($hash, $this->path, $file);
			}
		}
		return $logs;
	}
1122480
def logs(self, container=None, pretty=None, previous=False,
             since_seconds=None, since_time=None, timestamps=False,
             tail_lines=None, limit_bytes=None):
        
        log_call = "log"
        params = {}
        if container is not None:
            params["container"] = container
        if pretty is not None:
            params["pretty"] = pretty
        if previous:
            params["previous"] = "true"
        if since_seconds is not None and since_time is None:
            params["sinceSeconds"] = int(since_seconds)
        elif since_time is not None and since_seconds is None:
            params["sinceTime"] = since_time
        if timestamps:
            params["timestamps"] = "true"
        if tail_lines is not None:
            params["tailLines"] = int(tail_lines)
        if limit_bytes is not None:
            params["limitBytes"] = int(limit_bytes)

        query_string = urlencode(params)
        log_call += "?{}".format(query_string) if query_string else ""
        kwargs = {
            "version": self.version,
            "namespace": self.namespace,
            "operation": log_call,
        }
        r = self.api.get(**self.api_kwargs(**kwargs))
        r.raise_for_status()
        return r.text
1207461
def get_logs_from_db_reading(job_prefix, reading_queue='run_db_reading_queue'):
    """"""
    s3 = boto3.client('s3')
    gen_prefix = 'reading_results/%s/logs/%s' % (job_prefix, reading_queue)
    job_log_data = s3.list_objects_v2(Bucket='bigmech',
                                      Prefix=join(gen_prefix, job_prefix))
    # TODO: Track success/failure
    log_strs = []
    for fdict in job_log_data['Contents']:
        resp = s3.get_object(Bucket='bigmech', Key=fdict['Key'])
        log_strs.append(resp['Body'].read().decode('utf-8'))
    return log_strs
628221
public LogStreamResponse getLogs(Log.LogRequestBuilder logRequest) {
        return connection.execute(new Log(logRequest), apiKey);
    }
549236
def get_logs(self, project_name, spider_name):
        
        url, method = self.command_set['logs'][0] + project_name + '/' + spider_name + '/', self.command_set['logs'][1]
        response = http_utils.request(url, method_type=method)
        html_parser = ScrapydLogsPageHTMLParser()
        html_parser.feed(response)
        html_parser.clean_enter_sign()
        return html_parser.result, [url + x for x in html_parser.result]
278135
def _log(self):
        """"""
        self._log_platform()
        self._log_app_data()
        self._log_python_version()
        self._log_tcex_version()
        self._log_tc_proxy()
1155784
protected function getLogs(): array
	{
		if ($this->logs === null) {
			$this->logs = $this->readLogs();
		}
		return $this->logs;
	}
173743
def get_email_logs(self):
        '''
        
        '''
        message = ""
        for log in self.record:
            if log["log_type"] in [ERROR, WARNING]:
                message += self.format_message(**log)

        return message
963499
def _log_http_event(response):
        
        logger.info(
            '{ip} - - "{method} {path} {status_code}"'.format(
                ip=request.remote_addr,
                method=request.method,
                path=request.path,
                status_code=response.status_code)
        )
        return response
95708
def on_log(request, page_name):
    """"""
    page = Page.query.filter_by(name=page_name).first()
    if page is None:
        return page_missing(request, page_name, False)
    return Response(generate_template("action_log.html", page=page))
972191
def _log_request(self, request):
        
        msg = []
        for d in self.LOG_DATA:
            val = getattr(request, d)
            if val:
                msg.append(d + ': ' + repr(val))
        for d in self.LOG_HEADERS:
            if d in request.headers and request.headers[d]:
                msg.append(d + ': ' + repr(request.headers[d]))
        logger.info("Request information: %s", ', '.join(msg))
1035698
def fetch_logs(self, lambda_name, filter_pattern='', limit=10000, start_time=0):
        
        log_name = '/aws/lambda/' + lambda_name
        streams = self.logs_client.describe_log_streams(
            logGroupName=log_name,
            descending=True,
            orderBy='LastEventTime'
        )

        all_streams = streams['logStreams']
        all_names = [stream['logStreamName'] for stream in all_streams]

        events = []
        response = {}
        while not response or 'nextToken' in response:
            extra_args = {}
            if 'nextToken' in response:
                extra_args['nextToken'] = response['nextToken']

            # Amazon uses millisecond epoch for some reason.
            # Thanks, Jeff.
            start_time = start_time * 1000
            end_time = int(time.time()) * 1000

            response = self.logs_client.filter_log_events(
                logGroupName=log_name,
                logStreamNames=all_names,
                startTime=start_time,
                endTime=end_time,
                filterPattern=filter_pattern,
                limit=limit,
                interleaved=True, # Does this actually improve performance?
                **extra_args
            )
            if response and 'events' in response:
                events += response['events']

        return sorted(events, key=lambda k: k['timestamp'])
509333
@Route(method = HttpMethod.GET, uri = "/monitor/logs/loggers")
    public Result loggers() {
        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        List<LoggerModel> loggers = new ArrayList<>();
        for (Logger logger : context.getLoggerList()) {
            loggers.add(new LoggerModel(logger));
        }
        return ok(loggers).json();
    }