提交 b8584f50 编写于 作者: S Stephen Connolly

[JENKINS-33068] While we are at it, let's move the logs to a subdir

上级 8ef48015
......@@ -164,6 +164,11 @@ public abstract class AsyncAperiodicWork extends AperiodicWork {
}
}
}
if (!f.getParentFile().isDirectory()) {
if (!f.getParentFile().mkdirs()) {
logger.log(getErrorLoggingLevel(), "Could not create directory {0}", f.getParentFile());
}
}
try {
return new StreamTaskListener(f, true, null);
} catch (IOException e) {
......@@ -175,7 +180,7 @@ public abstract class AsyncAperiodicWork extends AperiodicWork {
* Determines the log file that records the result of this task.
*/
protected File getLogFile() {
return new File(Jenkins.getInstance().getRootDir(),name+".log");
return new File(Jenkins.getInstance().getRootDir(),"logs/tasks/"+name+".log");
}
/**
......
......@@ -148,6 +148,11 @@ public abstract class AsyncPeriodicWork extends PeriodicWork {
}
}
}
if (!f.getParentFile().isDirectory()) {
if (!f.getParentFile().mkdirs()) {
logger.log(getErrorLoggingLevel(), "Could not create directory {0}", f.getParentFile());
}
}
try {
return new StreamTaskListener(f, true, null);
} catch (IOException e) {
......@@ -159,7 +164,7 @@ public abstract class AsyncPeriodicWork extends PeriodicWork {
* Determines the log file that records the result of this task.
*/
protected File getLogFile() {
return new File(Jenkins.getInstance().getRootDir(),name+".log");
return new File(Jenkins.getInstance().getRootDir(),"logs/tasks/"+name+".log");
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册