deason hace 6 años
padre
commit
f73fb0e365
Se han modificado 2 ficheros con 18 adiciones y 7 borrados
  1. 8 6
      pom.xml
  2. 10 1
      src/main/java/cn/com/qmth/examcloud/app/ApiApplication.java

+ 8 - 6
pom.xml

@@ -53,6 +53,14 @@
                     <groupId>org.ow2.asm</groupId>
                     <artifactId>asm</artifactId>
                 </exclusion>
+                <exclusion>
+                    <groupId>com.squareup.okhttp3</groupId>
+                    <artifactId>okhttp</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
@@ -117,12 +125,6 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-freemarker</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-tomcat</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 10 - 1
src/main/java/cn/com/qmth/examcloud/app/ApiApplication.java

@@ -7,18 +7,27 @@
 
 package cn.com.qmth.examcloud.app;
 
+import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.base.logging.SLF4JImpl;
 import cn.com.qmth.examcloud.commons.web.boot.ExamCloudApp;
-import org.springframework.boot.SpringApplication;
+import org.slf4j.MDC;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
 import org.springframework.scheduling.annotation.EnableAsync;
 
 @EnableAsync
+@EnableJpaAuditing
 @SpringBootApplication
 public class ApiApplication extends SpringBootServletInitializer {
+    private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(ApiApplication.class);
 
     public static void main(String[] args) {
+        if (LOG instanceof SLF4JImpl) {
+            MDC.put("TRACE_ID", Thread.currentThread().getName());
+        }
         //SpringApplication.run(ApiApplication.class, args);
         ExamCloudApp.run(ApiApplication.class, "app-api", args);
     }