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(); }