SpringApplication启动相关配置

24人浏览 / 0人评论

1.打印端口: 

	private static final Logger LOG = (Logger) LoggerFactory.getLogger(Application.class);

	public static void main(String[] args) {
		SpringApplication.run(IndexApplication.class, args);

		
		SpringApplication app = new SpringApplication(IndexApplication.class);
		Environment env = app.run(args).getEnvironment();
		LOG.info("启动成功!!");
		LOG.info("地址: \thttp://localhost:{}", env.getProperty("server.port"));

	}

 

全部评论