@Component @Slf4j public class RunConfig { @Value("${spring.datasource.url}") private String url; @PostConstruct public void init() { log.info("------------------------------------------启动数据库连接配置----------------------------------------------------------"); log.info(url); log.info("------------------------------------------启动数据库连接配置----------------------------------------------------------"); System.out.println("------------------------------------------启动数据库连接配置----------------------------------------------------------"); System.out.println(url); System.out.println("------------------------------------------启动数据库连接配置----------------------------------------------------------"); } }