hzzz 7 years ago
parent
commit
8cca2382f1
  1. 15
      designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  2. 12
      designer-realize/src/com/fr/start/module/DesignerActivator.java

15
designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -45,21 +45,6 @@ public class DesignerLogHandler {
private static final int ERRO_GAP_Y = -40; private static final int ERRO_GAP_Y = -40;
private static final int SERVER_GAP_Y = -20; private static final int SERVER_GAP_Y = -20;
static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override
public void envChanged() {
// envchange后需要重新读取webinf里的log4j配置, 重新添加appender
FineLoggerFactory.getLogger().addLogAppender(new LogHandler<DesignerLogAppender>() {
@Override
public DesignerLogAppender getHandler() {
return new DesignerLogAppender();
}
});
}
});
}
public static DesignerLogHandler getInstance() { public static DesignerLogHandler getInstance() {
return HOLDER.singleton; return HOLDER.singleton;
} }

12
designer-realize/src/com/fr/start/module/DesignerActivator.java

@ -51,6 +51,7 @@ import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormElementCaseDesigner;
import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.form.FormReportComponentComposite;
import com.fr.design.mainframe.loghandler.DesignerLogAppender;
import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.mainframe.loghandler.DesignerLogImpl;
import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.module.ChartHyperlinkGroup; import com.fr.design.module.ChartHyperlinkGroup;
@ -73,6 +74,7 @@ import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink; import com.fr.js.WebHyperlink;
import com.fr.locale.InterMutableKey; import com.fr.locale.InterMutableKey;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.module.extension.Prepare; import com.fr.module.extension.Prepare;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
@ -129,6 +131,16 @@ public class DesignerActivator extends Activator implements Prepare {
public void start() { public void start() {
designerModuleStart(); designerModuleStart();
preLoadPane(); preLoadPane();
loadLogAppender();
}
private static void loadLogAppender() {
FineLoggerFactory.getLogger().addLogAppender(new LogHandler<DesignerLogAppender>() {
@Override
public DesignerLogAppender getHandler() {
return new DesignerLogAppender();
}
});
} }
private static void designerModuleStart() { private static void designerModuleStart() {

Loading…
Cancel
Save