|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.kanban;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.PrintStream;
|
|
|
@@ -24,7 +25,11 @@ import com.uas.kanban.util.ContextUtils;
|
|
|
@EnableWebMvc
|
|
|
public class Application {
|
|
|
public static void main(String[] args) throws FileNotFoundException {
|
|
|
- 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)));
|
|
|
SpringApplication application = new SpringApplication(Application.class);
|
|
|
application.addListeners(new ApplicationListener<ApplicationPreparedEvent>() {
|
|
|
@Override
|