重写方法
/**
* 启动程序
*
* @author mock
*/
@Slf4j
@EnableAsync
@SpringBootApplication
public class MockApplication {
public static void main(String[] args) {
// 启动主程序
// run(VMockApplication.class, args);
SpringApplication app = new SpringApplication(MockApplication.class);
Environment env = app.run(args).getEnvironment();
log.info("\n----------------------------------------------------------\n\t" +
"com.test.service Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}\n\t" +
"Swagger API:http://127.0.0.1:{}/swagger-ui.html\n\t" +
"Druid index:http://127.0.0.1:{}/druid/index.html\n" +
"----------------------------------------------------------",
env.getProperty("spring.application.name"),
env.getProperty("server.port"),
getIpAddress(),
env.getProperty("server.port"),
env.getProperty("server.port"),
env.getProperty("server.port"));
}
private static String getIpAddress() {
try {
return InetAddress.getLocalHost().getHostAddress();
} catch (Exception e) {
log.error("", e);
return null;
}
}
}
程序启动效果
可以直接通过连接,打开网站,更方便,更快捷