public static void changeLogPath(String taskId){
Category cat = Logger.getRoot();
FileAppender fapp = (FileAppender) cat.getAppender("file");
if(fapp != null){
String filePath = fapp.getFile();
fapp.setFile(new File(filePath).getParent() + "/" + taskId + ".log");
fapp.activateOptions();
}
}
12-11
11-14
6439
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-07
2414
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)