1,引入Maven依赖:
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>1.0.0</version>
</dependency>
2,添加配置文件app.properties:
app.id=bidding
3,添加到配置文件application-dev.properties:
dev.meta=http://192.168.1.235:18080
添加到配置文件application-sit.properties:
sit.meta=http://192.168.1.235:18081
添加到配置文件application-uat.properties:
uat.meta=http://192.168.1.235:18082
4, 创建系统缓存目录:
Mac/Linux: /opt/data/
Windows: C:\opt\data\
5, 配置系统环境信息:
对于Mac/Linux,文件位置为/opt/settings/server.properties
对于Windows,文件位置为C:\opt\settings\server.properties
文件内容为:env=DEV,大小写不敏感(其它环境如sit,uat)
6, 托管application.properties的内容,删除除日志文件配置的其它配置信息:
保留:logging.config=classpath:saas_logger-dev.xml
注意:本地配置的日志文件配置信息不能删除,否则程序无法运行。