From 509142cbef5d0c4db4534df10c63a34629b26e94 Mon Sep 17 00:00:00 2001 From: Anner Date: Sun, 29 Sep 2024 11:14:54 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-136120=20fix:=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E9=9C=80=E8=A6=81=E5=85=A8=E9=83=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/boot/env/DesignEnvComponent.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java index 2a04889c52..8a6e4bc077 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java @@ -11,6 +11,7 @@ import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Supplemental; import com.fanruan.config.ConfigProviderFactory; +import com.fanruan.config.LocalConfigSource; import com.fanruan.config.realm.ConfigRealm; import com.fanruan.dao.context.DBContextProvider; import com.fanruan.dao.context.DBContextStarter; @@ -64,12 +65,12 @@ import com.fr.intelli.record.Focus; import com.fr.intelli.record.FocusInterceptor; import com.fr.intelli.record.PerformancePoint; import com.fr.intelli.record.PerformancePointInterceptor; +import com.fr.invoke.Reflect; import com.fr.io.base.ResourcePaths; import com.fr.io.repository.ResourceRepository; import com.fr.io.repository.ResourceRepositoryWrapper; import com.fr.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; - import com.fr.record.analyzer.AnalyzerConfiguration; import com.fr.record.analyzer.AnalyzerMutableGroup; import com.fr.record.analyzer.DBMetrics; @@ -81,7 +82,6 @@ import com.fr.security.encryption.SystemEncryptionManager; import com.fr.security.encryption.core.EncryptionScaffold; import com.fr.security.encryption.provider.SecuritySeedProvider; import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey; - import com.fr.stable.StringUtils; import com.fr.stable.db.DBContext; import com.fr.stable.db.properties.FineMicroServicesDBProperties; @@ -102,7 +102,6 @@ import com.fr.transaction.HibernateTransactor; import com.fr.transaction.RemoteTransactor; import com.fr.transaction.TransactorFactory; import com.fr.workspace.WorkContext; -import com.fanruan.config.LocalConfigSource; import com.fr.workspace.server.repository.config.LocalConfigSourceShell; import java.net.URI; @@ -247,9 +246,14 @@ public class DesignEnvComponent { */ private void startLogger() { // 获取本地的日志级别配置 - Log4jConfigFactory.getInstance().setRootLevel(Log4jConfig.getInstance().getRootLevel()); + Level localLogPreferLevel = Log4jConfig.getInstance().getRootLevel(); + // 刷新到本地配置 + Log4jConfigFactory.getInstance().setRootLevel(localLogPreferLevel); URI uri = Log4jUtils.buildUserConfigURI(StringUtils.EMPTY); FRLogger.getLogger().config(uri); + // 刷新到carina的配置,防止 portal service 启动的时候覆盖了 + // 配置对象都是默认都文件读取的,设计器本地启动的阶段反射修改一下 + Reflect.on(Carina.properties(LoggerProperties.class)).set("level", localLogPreferLevel.name()); // 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下 listenConfig(); }