You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/23 14:44:51 UTC

[GitHub] [incubator-devlake] keon94 commented on a diff in pull request #2781: [feat-2742]: Handle logging config

keon94 commented on code in PR #2781:
URL: https://github.com/apache/incubator-devlake/pull/2781#discussion_r952722497


##########
.env.example:
##########
@@ -27,7 +27,6 @@ TEMPORAL_URL=
 TEMPORAL_TASK_QUEUE=
 # Debug Info Warn Error
 LOGGING_LEVEL=
-LOGGING_DIR=./logs

Review Comment:
   done



##########
services/pipeline.go:
##########
@@ -389,13 +389,13 @@ func CancelPipeline(pipelineId uint64) error {
 // getPipelineLogsPath gets the logs directory of this pipeline
 func getPipelineLogsPath(pipeline *models.Pipeline) (string, error) {
 	pipelineLog := getPipelineLogger(pipeline)
-	path := filepath.Dir(pipelineLog.GetConfig().Path)
+	path := pipelineLog.GetConfig().Path
 	_, err := os.Stat(path)
 	if err == nil {
-		return path, nil
+		return filepath.Dir(path), nil
 	}
 	if os.IsNotExist(err) {
-		return "", fmt.Errorf("logs for pipeline #%d not found: %v", pipeline.ID, err)
+		return "", fmt.Errorf("logs for pipeline #%d not found: %w", pipeline.ID, err)

Review Comment:
   done



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

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