直接pom文件引入logback1.3.7版本

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.5</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.3.7}</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-core</artifactId>
    <version>1.3.7</version>
</dependency>

这时候启动就会报错Exception in thread "main" java.lang.NoClassDefFoundErro 

需要在启动类加入:

System.setProperty("org.springframework.boot.logging.LoggingSystem", "none");

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
	public static void main(String[] args) {
		try {
			System.setProperty("org.springframework.boot.logging.LoggingSystem", "none");
			SpringApplication.run(EurekaApplication.class, args);
			System.out.println("====================启动成功====================");

		}catch (Exception e){
			System.out.println(e);
		}
	}
}

这时候启动就可以了

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐