@ -23,6 +23,7 @@ import com.fanruan.fs.DesignFileRepository;
import com.fanruan.fs.FileServer ;
import com.fanruan.fs.FileServer ;
import com.fanruan.fs.RepositoryFactory ;
import com.fanruan.fs.RepositoryFactory ;
import com.fanruan.fs.repository.local.LocalFileRepository ;
import com.fanruan.fs.repository.local.LocalFileRepository ;
import com.fanruan.gui.utils.Reflect ;
import com.fanruan.kv.CarinaKV ;
import com.fanruan.kv.CarinaKV ;
import com.fanruan.kv.factory.KVStoreFactory ;
import com.fanruan.kv.factory.KVStoreFactory ;
import com.fanruan.kv.manager.CarinaKVManager ;
import com.fanruan.kv.manager.CarinaKVManager ;
@ -60,7 +61,6 @@ import com.fr.event.EventDispatcher;
import com.fr.general.FRLogger ;
import com.fr.general.FRLogger ;
import com.fr.general.log.Log4jConfig ;
import com.fr.general.log.Log4jConfig ;
import com.fr.general.log.Log4jConfigFactory ;
import com.fr.general.log.Log4jConfigFactory ;
import com.fr.general.log.Log4jUtils ;
import com.fr.intelli.metrics.Compute ;
import com.fr.intelli.metrics.Compute ;
import com.fr.intelli.metrics.DBMonitorInterceptor ;
import com.fr.intelli.metrics.DBMonitorInterceptor ;
import com.fr.intelli.metrics.MonitorInterceptor ;
import com.fr.intelli.metrics.MonitorInterceptor ;
@ -68,7 +68,6 @@ import com.fr.intelli.record.Focus;
import com.fr.intelli.record.FocusInterceptor ;
import com.fr.intelli.record.FocusInterceptor ;
import com.fr.intelli.record.PerformancePoint ;
import com.fr.intelli.record.PerformancePoint ;
import com.fr.intelli.record.PerformancePointInterceptor ;
import com.fr.intelli.record.PerformancePointInterceptor ;
import com.fr.invoke.Reflect ;
import com.fr.io.base.ResourcePaths ;
import com.fr.io.base.ResourcePaths ;
import com.fr.io.repository.ResourceRepository ;
import com.fr.io.repository.ResourceRepository ;
import com.fr.io.repository.ResourceRepositoryWrapper ;
import com.fr.io.repository.ResourceRepositoryWrapper ;
@ -93,7 +92,6 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.tenant.context.TenantContext ;
import com.fr.tenant.context.TenantContext ;
import com.fr.tenant.context.provider.CurrentTenantKey ;
import com.fr.tenant.context.provider.CurrentTenantKey ;
import com.fr.third.apache.logging.log4j.Level ;
import com.fr.third.apache.logging.log4j.Level ;
import com.fr.third.apache.logging.log4j.core.config.Configurator ;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation ;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation ;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers ;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers ;
import com.fr.third.org.hibernate.jdbc.AbstractWork ;
import com.fr.third.org.hibernate.jdbc.AbstractWork ;
@ -106,7 +104,6 @@ import com.fr.transaction.RemoteTransactor;
import com.fr.transaction.TransactorFactory ;
import com.fr.transaction.TransactorFactory ;
import com.fr.workspace.WorkContext ;
import com.fr.workspace.WorkContext ;
import java.net.URI ;
import java.sql.Connection ;
import java.sql.Connection ;
import java.sql.SQLException ;
import java.sql.SQLException ;
import java.util.Properties ;
import java.util.Properties ;
@ -247,16 +244,12 @@ public class DesignEnvComponent {
* - - - - - - - - - - - logger - - - - - - - -
* - - - - - - - - - - - logger - - - - - - - -
* /
* /
private void startLogger ( ) {
private void startLogger ( ) {
// 获取本地的日志级别配置
Level localLogPreferLevel = Log4jConfig . getInstance ( ) . getRootLevel ( ) ;
// 刷新到本地配置
// 刷新到本地配置
Log4jConfigFactory . getInstance ( ) . updateConfigLoggerLevel ( localLogPreferLevel . name ( ) ) ;
Level localLogPreferLevel = Log4jConfig . getInstance ( ) . getRootLevel ( ) ;
URI uri = Log4jUtils . buildUserConfigURI ( StringUtils . EMPTY ) ;
Log4jConfigFactory . getInstance ( ) . updateMemoryLoggerLevel ( localLogPreferLevel . name ( ) ) ;
FRLogger . getLogger ( ) . config ( uri ) ;
// 刷新到carina的配置,防止 portal service 启动的时候覆盖了
// 刷新到carina的配置,防止 portal service 启动的时候覆盖了
// 配置对象都是默认都文件读取的,设计器本地启动的阶段反射修改一下
// 配置对象都是默认都文件读取的,设计器本地启动的阶段反射修改一下
Reflect . on ( Carina . properties ( LoggerProperties . class ) ) . set ( "level" , localLogPreferLevel . name ( ) ) ;
Reflect . on ( Carina . properties ( LoggerProperties . class ) ) . set ( "level" , localLogPreferLevel . name ( ) ) ;
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
listenConfig ( ) ;
listenConfig ( ) ;
}
}
@ -270,8 +263,7 @@ public class DesignEnvComponent {
@Override
@Override
public void change ( ) {
public void change ( ) {
// The root logger is the topmost logger with a name of "" (the empty string).
Log4jConfigFactory . getInstance ( ) . updateMemoryLoggerLevel ( Log4jConfig . getInstance ( ) . getRootLevel ( ) . name ( ) ) ;
Configurator . setAllLevels ( "" , Log4jConfig . getInstance ( ) . getRootLevel ( ) ) ;
}
}
} ) ;
} ) ;
}
}