tianyun před 3 roky
rodič
revize
192d96b478

+ 6 - 1
springboot-main/pom.xml

@@ -79,7 +79,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-aop</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.7.25</version>
+            <scope>compile</scope>
+        </dependency>
         <!-- lombok -->
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 3 - 1
springboot-main/src/main/java/com/alvin/Application.java

@@ -1,10 +1,12 @@
 package com.alvin;
 
+import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+@Slf4j
 @SpringBootApplication
 @MapperScan("com.alvin.dao.mapper")
 public class Application implements CommandLineRunner {
@@ -15,7 +17,7 @@ public class Application implements CommandLineRunner {
 
     @Override
     public void run(String... args) throws Exception {
-        System.out.println("启动成功");
+        log.info("启动成功");
     }
 
 }

+ 0 - 0
springboot-main/src/main/resources/logback.xml → springboot-main/src/main/resources/logback-spring.xml