|
@@ -1,13 +1,23 @@
|
|
|
package com.book.server;
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
|
|
|
|
|
@SpringBootApplication
|
|
|
@EnableCaching
|
|
|
-public class Application {
|
|
|
+@Slf4j
|
|
|
+public class Application implements CommandLineRunner {
|
|
|
public static void main(String[] args) {
|
|
|
+ //日志异步
|
|
|
+ System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
|
|
|
SpringApplication.run(Application.class);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void run(String... args) throws Exception {
|
|
|
+ log.info("启动成功");
|
|
|
+ }
|
|
|
}
|