diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/pom.xml b/lab-45/lab-45-apollo-demo-auto-refresh/pom.xml
new file mode 100644
index 00000000..150bad5e
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/pom.xml
@@ -0,0 +1,30 @@
+
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.2.RELEASE
+
+
+ 4.0.0
+
+ lab-45-apollo-demo-auto-refresh
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+ com.ctrip.framework.apollo
+ apollo-client
+ 1.5.1
+
+
+
+
diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/Application.java b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/Application.java
new file mode 100644
index 00000000..b3bdae21
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/Application.java
@@ -0,0 +1,13 @@
+package cn.iocoder.springboot.lab45.apollodemo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+}
diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/controller/DemoController.java b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/controller/DemoController.java
new file mode 100644
index 00000000..333314aa
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/controller/DemoController.java
@@ -0,0 +1,39 @@
+package cn.iocoder.springboot.lab45.apollodemo.controller;
+
+import cn.iocoder.springboot.lab45.apollodemo.properties.TestProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/demo")
+public class DemoController {
+
+ @Value("${test.test}")
+ private String test;
+
+ @GetMapping("/test")
+ public String test() {
+ return test;
+ }
+
+ @Autowired
+ private TestProperties testProperties;
+
+ @GetMapping("/test_properties")
+ public TestProperties testProperties() {
+ return testProperties;
+ }
+
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ @GetMapping("/logger")
+ public void logger() {
+ logger.debug("[logger][测试一下]");
+ }
+
+}
diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/listener/LoggingSystemConfigListener.java b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/listener/LoggingSystemConfigListener.java
new file mode 100644
index 00000000..b88e338f
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/listener/LoggingSystemConfigListener.java
@@ -0,0 +1,37 @@
+package cn.iocoder.springboot.lab45.apollodemo.listener;
+
+import org.springframework.boot.logging.LoggingSystem;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+@Component
+public class LoggingSystemConfigListener {
+
+ /**
+ * 日志配置项的前缀
+ */
+ private static final String LOGGER_TAG = "logging.level.";
+
+ @Resource
+ private LoggingSystem loggingSystem;
+
+// @NacosConfigListener(dataId = "${nacos.config.data-id}", type = ConfigType.YAML, timeout = 5000)
+// public void onChange(String newLog) throws Exception {
+// // 使用 DefaultYamlConfigParse 工具类,解析配置
+// Properties properties = new DefaultYamlConfigParse().parse(newLog);
+// // 遍历配置集的每个配置项,判断是否是 logging.level 配置项
+// for (Object t : properties.keySet()) {
+// String key = String.valueOf(t);
+// // 如果是 logging.level 配置项,则设置其对应的日志级别
+// if (key.startsWith(LOGGER_TAG)) {
+// // 获得日志级别
+// String strLevel = properties.getProperty(key, "info");
+// LogLevel level = LogLevel.valueOf(strLevel.toUpperCase());
+// // 设置日志级别到 LoggingSystem 中
+// loggingSystem.setLogLevel(key.replace(LOGGER_TAG, ""), level);
+// }
+// }
+// }
+
+}
diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/properties/TestProperties.java b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/properties/TestProperties.java
new file mode 100644
index 00000000..6cb5be18
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/java/cn/iocoder/springboot/lab45/apollodemo/properties/TestProperties.java
@@ -0,0 +1,24 @@
+package cn.iocoder.springboot.lab45.apollodemo.properties;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "test")
+public class TestProperties {
+
+ /**
+ * 测试属性
+ */
+ private String test;
+
+ public String getTest() {
+ return test;
+ }
+
+ public TestProperties setTest(String test) {
+ this.test = test;
+ return this;
+ }
+
+}
diff --git a/lab-45/lab-45-apollo-demo-auto-refresh/src/main/resources/application.yaml b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/resources/application.yaml
new file mode 100644
index 00000000..27c26fd5
--- /dev/null
+++ b/lab-45/lab-45-apollo-demo-auto-refresh/src/main/resources/application.yaml
@@ -0,0 +1,13 @@
+server:
+ port: 7070 # 避免和本地的 Apollo Portal 端口冲突
+
+app:
+ id: demo-application # 使用的 Apollo 的项目(应用)编号
+apollo:
+ meta: http://127.0.0.1:8080 # Apollo Meta Server 地址
+ bootstrap:
+ enabled: true # 是否开启 Apollo 配置预加载功能。默认为 false。
+ eagerLoad:
+ enable: true # 是否开启 Apollo 支持日志级别的加载时机。默认为 false。
+ namespaces: application # 使用的 Apollo 的命名空间,默认为 application。
+
diff --git a/lab-45/pom.xml b/lab-45/pom.xml
index 8d02ac8e..b730d4ff 100644
--- a/lab-45/pom.xml
+++ b/lab-45/pom.xml
@@ -14,6 +14,7 @@
lab-45-apollo-demo
lab-45-apollo-demo-profiles
+ lab-45-apollo-demo-auto-refresh