Browse Source

REPORT-126951 【仅FBP有问题】-设计器菜单栏-文件-选项-高级-log导出配置

mss/2.0
Destiny.Lin 4 months ago
parent
commit
5f836e3145
  1. 24
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java

24
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -31,6 +31,7 @@ import com.fr.cluster.ClusterBridge;
import com.fr.cluster.lock.ClusterLock;
import com.fr.config.BaseDBEnv;
import com.fr.config.ConfigEvent;
import com.fr.config.Configuration;
import com.fr.config.FinalPreferenceConfig;
import com.fr.config.dao.DaoContext;
import com.fr.config.dao.impl.BatchSubmitClassHelperDao;
@ -42,6 +43,8 @@ import com.fr.config.dao.impl.hibernate.HibernateXmlEnityDao;
import com.fr.config.dao.impl.remote.RemoteClassHelperDao;
import com.fr.config.dao.impl.remote.RemoteEntityDao;
import com.fr.config.dao.impl.remote.RemoteXmlEntityDao;
import com.fr.config.holder.ConfigChangeListener;
import com.fr.config.holder.ValidateConfigManger;
import com.fr.config.impl.ConfConfigProviderImpl;
import com.fr.config.impl.ConfigInsecurityElementProviderImpl;
import com.fr.decision.service.context.ServiceContext;
@ -54,6 +57,7 @@ import com.fr.design.backup.EnvBackupHelper;
import com.fr.env.detect.EnvDetectorCenter;
import com.fr.event.EventDispatcher;
import com.fr.general.FRLogger;
import com.fr.general.log.Log4jConfig;
import com.fr.general.log.Log4jUtils;
import com.fr.intelli.metrics.Compute;
import com.fr.intelli.metrics.DBMonitorInterceptor;
@ -86,6 +90,7 @@ import com.fr.stable.db.session.DBSession;
import com.fr.stable.project.ProjectConstants;
import com.fr.tenant.context.TenantContext;
import com.fr.tenant.context.provider.CurrentTenantKey;
import com.fr.third.apache.logging.log4j.core.config.Configurator;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
import com.fr.third.org.hibernate.jdbc.AbstractWork;
@ -235,6 +240,25 @@ public class DesignEnvComponent {
String realPath = Carina.properties(LoggerProperties.class).getXml();
URI uri = Log4jUtils.buildUserConfigURI(realPath);
FRLogger.getLogger().config(uri);
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
listenConfig();
}
private void listenConfig() {
ValidateConfigManger.getInstance().registerListener(new ConfigChangeListener() {
@Override
public boolean accept(Class<? extends Configuration> configClass) {
return configClass.equals(Log4jConfig.class);
}
@Override
public void change() {
// The root logger is the topmost logger with a name of "" (the empty string).
Configurator.setAllLevels("", Log4jConfig.getInstance().getRootLevel());
}
});
}
private void stopLogger() {

Loading…
Cancel
Save