[ 
https://issues.apache.org/jira/browse/KYLIN-4813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235150#comment-17235150
 ] 

ASF GitHub Bot commented on KYLIN-4813:
---------------------------------------

hit-lacus commented on a change in pull request #1481:
URL: https://github.com/apache/kylin/pull/1481#discussion_r526573750



##########
File path: 
server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
##########
@@ -160,17 +168,41 @@ public JobInstance get(@PathVariable String jobId) {
      * @return
      * @throws IOException
      */
+
     @RequestMapping(value = "/{jobId}/steps/{stepId}/output", method = { 
RequestMethod.GET }, produces = {
             "application/json" })
     @ResponseBody
     public Map<String, String> getStepOutput(@PathVariable String jobId, 
@PathVariable String stepId) {
         Map<String, String> result = new HashMap<String, String>();
         result.put("jobId", jobId);
         result.put("stepId", String.valueOf(stepId));
-        result.put("cmd_output", 
jobService.getExecutableManager().getOutput(stepId).getVerboseMsg());
+        result.put("cmd_output", jobService.getJobOutput(jobId, stepId));
         return result;
     }
 
+    /**
+     * Download a job step output from hdfs
+     * @param jobId
+     * @param stepId
+     * @param project
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/{job_id:.+}/steps/{step_id:.+}/log", method = { 
RequestMethod.GET }, produces = { "application/json" })
+    @ResponseBody
+    public EnvelopeResponse<String> downloadLogFile(@PathVariable("job_id") 
String jobId,
+                                                    @PathVariable("step_id") 
String stepId, @RequestParam(value = "project") String project,
+                                                    HttpServletResponse 
response) throws IOException {
+        checkRequiredArg("job_id", jobId);
+        checkRequiredArg("step_id", stepId);
+        checkRequiredArg("project", project);
+        String downloadFilename = String.format(Locale.ROOT, "%s_%s.log", 
project, stepId);

Review comment:
       Please check report from LGTM or search "HTTP Response Splitting" for 
background.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refine spark logger for Kylin 4 build engine
> --------------------------------------------
>
>                 Key: KYLIN-4813
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4813
>             Project: Kylin
>          Issue Type: Improvement
>    Affects Versions: v4.0.0-alpha
>            Reporter: Xiaoxiang Yu
>            Assignee: Yaqian Zhang
>            Priority: Major
>             Fix For: v4.0.0-beta
>
>
> - Separate spark log from kylin log
> - Store driver/executor log into HDFS.
> - Provided a API to view driver log.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to