|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.report;
|
|
package com.uas.report;
|
|
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.PrintStream;
|
|
import java.io.PrintStream;
|
|
@@ -32,7 +33,11 @@ public class Application extends SpringBootServletInitializer implements Applica
|
|
|
@Override
|
|
@Override
|
|
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
|
|
try {
|
|
try {
|
|
|
- System.setErr(new PrintStream(new FileOutputStream("logs/log.log", true)));
|
|
|
|
|
|
|
+ File logFile = new File("logs/log.log");
|
|
|
|
|
+ if (!logFile.getParentFile().exists()) {
|
|
|
|
|
+ logFile.getParentFile().mkdir();
|
|
|
|
|
+ }
|
|
|
|
|
+ System.setErr(new PrintStream(new FileOutputStream(logFile, true)));
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
|
logger.error("", e);
|
|
logger.error("", e);
|
|
|
}
|
|
}
|